| OLD | NEW |
| 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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 callback); | 895 callback); |
| 896 } | 896 } |
| 897 | 897 |
| 898 void WebViewGuest::WillAttachToEmbedder() { | 898 void WebViewGuest::WillAttachToEmbedder() { |
| 899 // We must install the mapping from guests to WebViews prior to resuming | 899 // We must install the mapping from guests to WebViews prior to resuming |
| 900 // suspended resource loads so that the WebRequest API will catch resource | 900 // suspended resource loads so that the WebRequest API will catch resource |
| 901 // requests. | 901 // requests. |
| 902 PushWebViewStateToIOThread(); | 902 PushWebViewStateToIOThread(); |
| 903 } | 903 } |
| 904 | 904 |
| 905 content::JavaScriptDialogManager* | 905 content::JavaScriptDialogManager* WebViewGuest::GetJavaScriptDialogManager( |
| 906 WebViewGuest::GetJavaScriptDialogManager() { | 906 WebContents* source) { |
| 907 return &javascript_dialog_helper_; | 907 return &javascript_dialog_helper_; |
| 908 } | 908 } |
| 909 | 909 |
| 910 content::ColorChooser* WebViewGuest::OpenColorChooser( | 910 content::ColorChooser* WebViewGuest::OpenColorChooser( |
| 911 WebContents* web_contents, | 911 WebContents* web_contents, |
| 912 SkColor color, | 912 SkColor color, |
| 913 const std::vector<content::ColorSuggestion>& suggestions) { | 913 const std::vector<content::ColorSuggestion>& suggestions) { |
| 914 if (!attached() || !embedder_web_contents()->GetDelegate()) | 914 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 915 return NULL; | 915 return NULL; |
| 916 return embedder_web_contents()->GetDelegate()->OpenColorChooser( | 916 return embedder_web_contents()->GetDelegate()->OpenColorChooser( |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 WebViewGuest* guest = | 1231 WebViewGuest* guest = |
| 1232 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1232 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1233 if (!guest) | 1233 if (!guest) |
| 1234 return; | 1234 return; |
| 1235 | 1235 |
| 1236 if (!allow) | 1236 if (!allow) |
| 1237 guest->Destroy(); | 1237 guest->Destroy(); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 } // namespace extensions | 1240 } // namespace extensions |
| OLD | NEW |