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

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

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 years, 7 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
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 "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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 content::RenderViewHost* render_view_host) { 784 content::RenderViewHost* render_view_host) {
785 if (frame_id == main_frame_id_) 785 if (frame_id == main_frame_id_)
786 InjectChromeVoxIfNeeded(render_view_host); 786 InjectChromeVoxIfNeeded(render_view_host);
787 } 787 }
788 788
789 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) { 789 void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) {
790 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 790 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
791 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass())); 791 DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass()));
792 } 792 }
793 793
794 void WebViewGuest::WebContentsDestroyed(WebContents* web_contents) { 794 void WebViewGuest::WebContentsDestroyed() {
795 // Clean up custom context menu items for this guest. 795 // Clean up custom context menu items for this guest.
796 extensions::MenuManager* menu_manager = extensions::MenuManager::Get( 796 extensions::MenuManager* menu_manager = extensions::MenuManager::Get(
797 Profile::FromBrowserContext(browser_context())); 797 Profile::FromBrowserContext(browser_context()));
798 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey( 798 menu_manager->RemoveAllContextItems(extensions::MenuItem::ExtensionKey(
799 embedder_extension_id(), view_instance_id())); 799 embedder_extension_id(), view_instance_id()));
800 800
801 RemoveWebViewFromExtensionRendererState(web_contents); 801 RemoveWebViewFromExtensionRendererState(web_contents());
802 } 802 }
803 803
804 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) { 804 void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) {
805 content::NavigationController& controller = 805 content::NavigationController& controller =
806 guest_web_contents()->GetController(); 806 guest_web_contents()->GetController();
807 content::NavigationEntry* entry = controller.GetVisibleEntry(); 807 content::NavigationEntry* entry = controller.GetVisibleEntry();
808 if (!entry) 808 if (!entry)
809 return; 809 return;
810 entry->SetIsOverridingUserAgent(!user_agent.empty()); 810 entry->SetIsOverridingUserAgent(!user_agent.empty());
811 if (!attached()) { 811 if (!attached()) {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 if (request_id != pending_context_menu_request_id_) 1074 if (request_id != pending_context_menu_request_id_)
1075 return; 1075 return;
1076 1076
1077 // TODO(lazyboy): Implement. 1077 // TODO(lazyboy): Implement.
1078 DCHECK(!items); 1078 DCHECK(!items);
1079 1079
1080 ContextMenuDelegate* menu_delegate = 1080 ContextMenuDelegate* menu_delegate =
1081 ContextMenuDelegate::FromWebContents(guest_web_contents()); 1081 ContextMenuDelegate::FromWebContents(guest_web_contents());
1082 menu_delegate->ShowMenu(pending_menu_.Pass()); 1082 menu_delegate->ShowMenu(pending_menu_.Pass());
1083 } 1083 }
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/web_view/web_view_guest.h ('k') | chrome/browser/history/history_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698