Commit 9549ee3b authored by fsamuel's avatar fsamuel Committed by Commit bot

Move Color Picker Plumbing From WebViewGuest to GuestViewBase

This allows all GuestView types to have access to a color picker.

BUG=451737

Review URL: https://codereview.chromium.org/889873004

Cr-Commit-Position: refs/heads/master@{#314035}
parent 2da6713c
...@@ -593,6 +593,17 @@ void GuestViewBase::LoadingStateChanged(content::WebContents* source, ...@@ -593,6 +593,17 @@ void GuestViewBase::LoadingStateChanged(content::WebContents* source,
embedder_web_contents(), to_different_document); embedder_web_contents(), to_different_document);
} }
content::ColorChooser* GuestViewBase::OpenColorChooser(
WebContents* web_contents,
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) {
if (!attached() || !embedder_web_contents()->GetDelegate())
return nullptr;
return embedder_web_contents()->GetDelegate()->OpenColorChooser(
web_contents, color, suggestions);
}
void GuestViewBase::RunFileChooser(WebContents* web_contents, void GuestViewBase::RunFileChooser(WebContents* web_contents,
const content::FileChooserParams& params) { const content::FileChooserParams& params) {
if (!attached() || !embedder_web_contents()->GetDelegate()) if (!attached() || !embedder_web_contents()->GetDelegate())
......
...@@ -310,6 +310,10 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, ...@@ -310,6 +310,10 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
const content::NativeWebKeyboardEvent& event) override; const content::NativeWebKeyboardEvent& event) override;
void LoadingStateChanged(content::WebContents* source, void LoadingStateChanged(content::WebContents* source,
bool to_different_document) final; bool to_different_document) final;
content::ColorChooser* OpenColorChooser(
content::WebContents* web_contents,
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) override;
void RunFileChooser(content::WebContents* web_contents, void RunFileChooser(content::WebContents* web_contents,
const content::FileChooserParams& params) override; const content::FileChooserParams& params) override;
bool ShouldFocusPageAfterCrash() final; bool ShouldFocusPageAfterCrash() final;
......
...@@ -861,16 +861,6 @@ content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager( ...@@ -861,16 +861,6 @@ content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager(
return &javascript_dialog_helper_; return &javascript_dialog_helper_;
} }
content::ColorChooser* WebViewGuest::OpenColorChooser(
WebContents* web_contents,
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) {
if (!attached() || !embedder_web_contents()->GetDelegate())
return nullptr;
return embedder_web_contents()->GetDelegate()->OpenColorChooser(
web_contents, color, suggestions);
}
void WebViewGuest::NavigateGuest(const std::string& src, void WebViewGuest::NavigateGuest(const std::string& src,
bool force_navigation) { bool force_navigation) {
if (src.empty()) if (src.empty())
......
...@@ -145,10 +145,6 @@ class WebViewGuest : public GuestView<WebViewGuest>, ...@@ -145,10 +145,6 @@ class WebViewGuest : public GuestView<WebViewGuest>,
const base::Callback<void(bool)>& callback) override; const base::Callback<void(bool)>& callback) override;
content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::JavaScriptDialogManager* GetJavaScriptDialogManager(
content::WebContents* source) override; content::WebContents* source) override;
content::ColorChooser* OpenColorChooser(
content::WebContents* web_contents,
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) override;
void AddNewContents(content::WebContents* source, void AddNewContents(content::WebContents* source,
content::WebContents* new_contents, content::WebContents* new_contents,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment