| 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 content::RenderViewHost* render_view_host) { | 741 content::RenderViewHost* render_view_host) { |
| 742 if (frame_id == main_frame_id_) | 742 if (frame_id == main_frame_id_) |
| 743 InjectChromeVoxIfNeeded(render_view_host); | 743 InjectChromeVoxIfNeeded(render_view_host); |
| 744 } | 744 } |
| 745 | 745 |
| 746 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) { | 746 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) { |
| 747 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 747 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 748 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); | 748 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); |
| 749 } | 749 } |
| 750 | 750 |
| 751 void WebViewGuest::WebContentsDestroyed(WebContents* web_contents) { | 751 void WebViewGuest::WebContentsDestroyed() { |
| 752 // Clean up custom context menu items for this guest. | 752 // Clean up custom context menu items for this guest. |
| 753 extensions::MenuManager* menu_manager = extensions::MenuManager::Get( | 753 extensions::MenuManager* menu_manager = extensions::MenuManager::Get( |
| 754 Profile::FromBrowserContext(browser_context())); | 754 Profile::FromBrowserContext(browser_context())); |
| 755 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey( | 755 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey( |
| 756 embedder_extension_id(), view_instance_id())); | 756 embedder_extension_id(), view_instance_id())); |
| 757 | 757 |
| 758 RemoveWebViewFromExtensionRendererState(web_contents); | 758 RemoveWebViewFromExtensionRendererState(web_contents()); |
| 759 } | 759 } |
| 760 | 760 |
| 761 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { | 761 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { |
| 762 content::NavigationController& controller = | 762 content::NavigationController& controller = |
| 763 guest_web_contents()->GetController(); | 763 guest_web_contents()->GetController(); |
| 764 content::NavigationEntry* entry = controller.GetVisibleEntry(); | 764 content::NavigationEntry* entry = controller.GetVisibleEntry(); |
| 765 if (!entry) | 765 if (!entry) |
| 766 return; | 766 return; |
| 767 entry->SetIsOverridingUserAgent(!user_agent.empty()); | 767 entry->SetIsOverridingUserAgent(!user_agent.empty()); |
| 768 if (!attached()) { | 768 if (!attached()) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 const PermissionResponseCallback& callback, | 1014 const PermissionResponseCallback& callback, |
| 1015 BrowserPluginPermissionType permission_type, | 1015 BrowserPluginPermissionType permission_type, |
| 1016 bool allowed_by_default) | 1016 bool allowed_by_default) |
| 1017 : callback(callback), | 1017 : callback(callback), |
| 1018 permission_type(permission_type), | 1018 permission_type(permission_type), |
| 1019 allowed_by_default(allowed_by_default) { | 1019 allowed_by_default(allowed_by_default) { |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 WebViewGuest::PermissionResponseInfo::~PermissionResponseInfo() { | 1022 WebViewGuest::PermissionResponseInfo::~PermissionResponseInfo() { |
| 1023 } | 1023 } |
| OLD | NEW |