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

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

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 callback); 892 callback);
893 } 893 }
894 894
895 void WebViewGuest::WillAttachToEmbedder() { 895 void WebViewGuest::WillAttachToEmbedder() {
896 // We must install the mapping from guests to WebViews prior to resuming 896 // We must install the mapping from guests to WebViews prior to resuming
897 // suspended resource loads so that the WebRequest API will catch resource 897 // suspended resource loads so that the WebRequest API will catch resource
898 // requests. 898 // requests.
899 PushWebViewStateToIOThread(); 899 PushWebViewStateToIOThread();
900 } 900 }
901 901
902 content::JavaScriptDialogManager* 902 content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager(
903 WebViewGuest::GetJavaScriptDialogManager() { 903 WebContents* source) {
904 return &javascript_dialog_helper_; 904 return &javascript_dialog_helper_;
905 } 905 }
906 906
907 content::ColorChooser* WebViewGuest::OpenColorChooser( 907 content::ColorChooser* WebViewGuest::OpenColorChooser(
908 WebContents* web_contents, 908 WebContents* web_contents,
909 SkColor color, 909 SkColor color,
910 const std::vector<content::ColorSuggestion>& suggestions) { 910 const std::vector<content::ColorSuggestion>& suggestions) {
911 if (!attached() || !embedder_web_contents()->GetDelegate()) 911 if (!attached() || !embedder_web_contents()->GetDelegate())
912 return NULL; 912 return NULL;
913 return embedder_web_contents()->GetDelegate()->OpenColorChooser( 913 return embedder_web_contents()->GetDelegate()->OpenColorChooser(
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 WebViewGuest* guest = 1243 WebViewGuest* guest =
1244 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); 1244 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id);
1245 if (!guest) 1245 if (!guest)
1246 return; 1246 return;
1247 1247
1248 if (!allow) 1248 if (!allow)
1249 guest->Destroy(); 1249 guest->Destroy();
1250 } 1250 }
1251 1251
1252 } // namespace extensions 1252 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698