Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 889873004: Move Color Picker Plumbing From WebViewGuest to GuestViewBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 // suspended resource loads so that the WebRequest API will catch resource 854 // suspended resource loads so that the WebRequest API will catch resource
855 // requests. 855 // requests.
856 PushWebViewStateToIOThread(); 856 PushWebViewStateToIOThread();
857 } 857 }
858 858
859 content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager( 859 content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager(
860 WebContents* source) { 860 WebContents* source) {
861 return &javascript_dialog_helper_; 861 return &javascript_dialog_helper_;
862 } 862 }
863 863
864 content::ColorChooser* WebViewGuest::OpenColorChooser(
865 WebContents* web_contents,
866 SkColor color,
867 const std::vector<content::ColorSuggestion>& suggestions) {
868 if (!attached() || !embedder_web_contents()->GetDelegate())
869 return nullptr;
870 return embedder_web_contents()->GetDelegate()->OpenColorChooser(
871 web_contents, color, suggestions);
872 }
873
874 void WebViewGuest::NavigateGuest(const std::string& src, 864 void WebViewGuest::NavigateGuest(const std::string& src,
875 bool force_navigation) { 865 bool force_navigation) {
876 if (src.empty()) 866 if (src.empty())
877 return; 867 return;
878 868
879 GURL url = ResolveURL(src); 869 GURL url = ResolveURL(src);
880 870
881 // Do not allow navigating a guest to schemes other than known safe schemes. 871 // Do not allow navigating a guest to schemes other than known safe schemes.
882 // This will block the embedder trying to load unwanted schemes, e.g. 872 // This will block the embedder trying to load unwanted schemes, e.g.
883 // chrome://settings. 873 // chrome://settings.
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(), 1213 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(),
1224 new_window_instance_id); 1214 new_window_instance_id);
1225 if (!guest) 1215 if (!guest)
1226 return; 1216 return;
1227 1217
1228 if (!allow) 1218 if (!allow)
1229 guest->Destroy(); 1219 guest->Destroy();
1230 } 1220 }
1231 1221
1232 } // namespace extensions 1222 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698