| 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 "chrome/browser/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/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 "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 content::RenderViewHost* render_view_host) { | 782 content::RenderViewHost* render_view_host) { |
| 783 if (frame_id == main_frame_id_) | 783 if (frame_id == main_frame_id_) |
| 784 InjectChromeVoxIfNeeded(render_view_host); | 784 InjectChromeVoxIfNeeded(render_view_host); |
| 785 } | 785 } |
| 786 | 786 |
| 787 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) { | 787 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) { |
| 788 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 788 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 789 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); | 789 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); |
| 790 } | 790 } |
| 791 | 791 |
| 792 void WebViewGuest::WebContentsDestroyed(WebContents* web_contents) { | 792 void WebViewGuest::WebContentsDestroyed() { |
| 793 // Clean up custom context menu items for this guest. | 793 // Clean up custom context menu items for this guest. |
| 794 extensions::MenuManager* menu_manager = extensions::MenuManager::Get( | 794 extensions::MenuManager* menu_manager = extensions::MenuManager::Get( |
| 795 Profile::FromBrowserContext(browser_context())); | 795 Profile::FromBrowserContext(browser_context())); |
| 796 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey( | 796 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey( |
| 797 embedder_extension_id(), view_instance_id())); | 797 embedder_extension_id(), view_instance_id())); |
| 798 | 798 |
| 799 RemoveWebViewFromExtensionRendererState(web_contents); | 799 RemoveWebViewFromExtensionRendererState(web_contents()); |
| 800 } | 800 } |
| 801 | 801 |
| 802 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { | 802 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { |
| 803 content::NavigationController& controller = | 803 content::NavigationController& controller = |
| 804 guest_web_contents()->GetController(); | 804 guest_web_contents()->GetController(); |
| 805 content::NavigationEntry* entry = controller.GetVisibleEntry(); | 805 content::NavigationEntry* entry = controller.GetVisibleEntry(); |
| 806 if (!entry) | 806 if (!entry) |
| 807 return; | 807 return; |
| 808 entry->SetIsOverridingUserAgent(!user_agent.empty()); | 808 entry->SetIsOverridingUserAgent(!user_agent.empty()); |
| 809 if (!attached()) { | 809 if (!attached()) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 const PermissionResponseCallback& callback, | 1055 const PermissionResponseCallback& callback, |
| 1056 BrowserPluginPermissionType permission_type, | 1056 BrowserPluginPermissionType permission_type, |
| 1057 bool allowed_by_default) | 1057 bool allowed_by_default) |
| 1058 : callback(callback), | 1058 : callback(callback), |
| 1059 permission_type(permission_type), | 1059 permission_type(permission_type), |
| 1060 allowed_by_default(allowed_by_default) { | 1060 allowed_by_default(allowed_by_default) { |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 WebViewGuest::PermissionResponseInfo::~PermissionResponseInfo() { | 1063 WebViewGuest::PermissionResponseInfo::~PermissionResponseInfo() { |
| 1064 } | 1064 } |
| OLD | NEW |