refactor: move color_chooser out of chromium_src (#15091)

* chore: move color_chooser out of chromium_src

* fix: remove deleted source files

* fix: add build flag, patch and build instructions for ColorChooser
This commit is contained in:
Heilig Benedek
2018-10-12 01:53:46 +02:00
committed by Samuel Attard
parent 95696c9456
commit 5ef5d60f77
13 changed files with 127 additions and 423 deletions

View File

@@ -507,3 +507,17 @@ patches:
* Adds patch in //chrome/browser/speech/tts_message_filter.cc
to remove reference to browser context when its signaled for
destruction from content layer.
-
author: Heilig Benedek <benecene@gmail.com>
file: color_chooser.patch
description: |
Removes a couple of stuff from the chromium implementation of ColorChooser
to decouple it from dependencies.
Most of the stuff removed is actually related to other dialog types that
we don't currently support, but chrome/browser/ui/browser_dialogs.h has
a function for them to create them. Also disables a DCHECK that crashes
the ColorChooser on Windows, that DCHECK most likely is an artifact that
remained in chromium from a long time ago (last update of that part of the
code was around 2012-2013, and this is purely UI, I don't think they have
automated tests for it).

View File

@@ -0,0 +1,74 @@
diff --git a/chrome/browser/ui/browser_dialogs.h b/chrome/browser/ui/browser_dialogs.h
index f57c1ded416a..59fdd948c3c5 100644
--- a/chrome/browser/ui/browser_dialogs.h
+++ b/chrome/browser/ui/browser_dialogs.h
@@ -4,7 +4,7 @@
#ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
#define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
-
+#if 0
#include <string>
#include <utility>
#include <vector>
@@ -17,6 +17,7 @@
#include "chrome/browser/ui/bookmarks/bookmark_editor.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/resource_request_info.h"
+#endif
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/native_widget_types.h"
@@ -66,7 +67,7 @@ struct SelectedFileInfo;
}
namespace chrome {
-
+#if 0
// Shows or hides the Task Manager. |browser| can be NULL when called from Ash.
// Returns a pointer to the underlying TableModel, which can be ignored, or used
// for testing.
@@ -129,11 +130,11 @@ void ShowBookmarkAppDialog(content::WebContents* web_contents,
void ShowPWAInstallDialog(content::WebContents* web_contents,
const WebApplicationInfo& web_app_info,
AppInstallationAcceptanceCallback callback);
-
+#endif
// Shows a color chooser that reports to the given WebContents.
content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,
SkColor initial_color);
-
+#if 0
#if defined(OS_MACOSX)
// Bridging methods that show/hide the toolkit-views based Task Manager on Mac.
@@ -301,13 +302,13 @@ void ShowChromeCleanerRebootPrompt(
safe_browsing::ChromeCleanerRebootDialogController* dialog_controller);
#endif // OS_WIN
-
+#endif
} // namespace chrome
-
+#if 0
void ShowFolderUploadConfirmationDialog(
const base::FilePath& path,
base::OnceCallback<void(const std::vector<ui::SelectedFileInfo>&)> callback,
std::vector<ui::SelectedFileInfo> selected_files,
content::WebContents* web_contents);
-
+#endif
#endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
diff --git a/chrome/browser/ui/views/color_chooser_win.cc b/chrome/browser/ui/views/color_chooser_win.cc
index 06381ef0e5ca..acb3a6e9e647 100644
--- a/chrome/browser/ui/views/color_chooser_win.cc
+++ b/chrome/browser/ui/views/color_chooser_win.cc
@@ -91,7 +91,7 @@ void ColorChooserWin::OnColorChooserDialogClosed() {
color_chooser_dialog_->ListenerDestroyed();
color_chooser_dialog_ = NULL;
}
- DCHECK(current_color_chooser_ == this);
+ // DCHECK(current_color_chooser_ == this);
current_color_chooser_ = NULL;
if (web_contents_)
web_contents_->DidEndColorChooser();