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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 13467038: Browser Plugin: Expose frame name changes to the content API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expose RenderViewHost::SetName to the content API Created 7 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 OnCancelDesktopNotification) 989 OnCancelDesktopNotification)
990 #if defined(OS_MACOSX) || defined(OS_ANDROID) 990 #if defined(OS_MACOSX) || defined(OS_ANDROID)
991 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup) 991 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup)
992 #endif 992 #endif
993 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) 993 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
994 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, 994 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse,
995 OnDomOperationResponse) 995 OnDomOperationResponse)
996 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Notifications, 996 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Notifications,
997 OnAccessibilityNotifications) 997 OnAccessibilityNotifications)
998 IPC_MESSAGE_HANDLER(ViewHostMsg_FrameTreeUpdated, OnFrameTreeUpdated) 998 IPC_MESSAGE_HANDLER(ViewHostMsg_FrameTreeUpdated, OnFrameTreeUpdated)
999 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFrameName, OnUpdateFrameName)
999 // Have the super handle all other messages. 1000 // Have the super handle all other messages.
1000 IPC_MESSAGE_UNHANDLED( 1001 IPC_MESSAGE_UNHANDLED(
1001 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) 1002 handled = RenderWidgetHostImpl::OnMessageReceived(msg))
1002 IPC_END_MESSAGE_MAP_EX() 1003 IPC_END_MESSAGE_MAP_EX()
1003 1004
1004 if (!msg_is_ok) { 1005 if (!msg_is_ok) {
1005 // The message had a handler, but its de-serialization failed. 1006 // The message had a handler, but its de-serialization failed.
1006 // Kill the renderer. 1007 // Kill the renderer.
1007 RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); 1008 RecordAction(UserMetricsAction("BadMessageTerminate_RVH"));
1008 GetProcess()->ReceivedBadMessage(); 1009 GetProcess()->ReceivedBadMessage();
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 VLOG(1) << "Blocked URL " << url->spec(); 1725 VLOG(1) << "Blocked URL " << url->spec();
1725 *url = GURL(chrome::kAboutBlankURL); 1726 *url = GURL(chrome::kAboutBlankURL);
1726 RecordAction(UserMetricsAction("FilterURLTermiate_Blocked")); 1727 RecordAction(UserMetricsAction("FilterURLTermiate_Blocked"));
1727 } 1728 }
1728 } 1729 }
1729 1730
1730 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { 1731 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) {
1731 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); 1732 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url));
1732 } 1733 }
1733 1734
1735 void RenderViewHostImpl::SetName(const std::string& name) {
1736 Send(new ViewMsg_SetName(GetRoutingID(), name));
1737 }
1738
1734 void RenderViewHostImpl::ExitFullscreen() { 1739 void RenderViewHostImpl::ExitFullscreen() {
1735 RejectMouseLockOrUnlockIfNecessary(); 1740 RejectMouseLockOrUnlockIfNecessary();
1736 // We need to notify the contents that its fullscreen state has changed. This 1741 // We need to notify the contents that its fullscreen state has changed. This
1737 // is done as part of the resize message. 1742 // is done as part of the resize message.
1738 WasResized(); 1743 WasResized();
1739 } 1744 }
1740 1745
1741 webkit_glue::WebPreferences RenderViewHostImpl::GetWebkitPreferences() { 1746 webkit_glue::WebPreferences RenderViewHostImpl::GetWebkitPreferences() {
1742 return delegate_->GetWebkitPrefs(); 1747 return delegate_->GetWebkitPrefs();
1743 } 1748 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 Details<DomOperationNotificationDetails>(&details)); 2001 Details<DomOperationNotificationDetails>(&details));
1997 } 2002 }
1998 2003
1999 void RenderViewHostImpl::OnFrameTreeUpdated(const std::string& frame_tree) { 2004 void RenderViewHostImpl::OnFrameTreeUpdated(const std::string& frame_tree) {
2000 // TODO(nasko): Remove once http://crbug.com/153701 is fixed. 2005 // TODO(nasko): Remove once http://crbug.com/153701 is fixed.
2001 DCHECK(false); 2006 DCHECK(false);
2002 frame_tree_ = frame_tree; 2007 frame_tree_ = frame_tree;
2003 delegate_->DidUpdateFrameTree(this); 2008 delegate_->DidUpdateFrameTree(this);
2004 } 2009 }
2005 2010
2011 void RenderViewHostImpl::OnUpdateFrameName(int frame_id,
2012 bool is_top_level,
2013 const std::string& name) {
2014 delegate_->DidUpdateFrameName(this, frame_id, is_top_level, name);
2015 }
2016
2017
2018
2006 void RenderViewHostImpl::OnGetWindowSnapshot(const int snapshot_id) { 2019 void RenderViewHostImpl::OnGetWindowSnapshot(const int snapshot_id) {
2007 std::vector<unsigned char> png; 2020 std::vector<unsigned char> png;
2008 2021
2009 // This feature is behind the kEnableGpuBenchmarking command line switch 2022 // This feature is behind the kEnableGpuBenchmarking command line switch
2010 // because it poses security concerns and should only be used for testing. 2023 // because it poses security concerns and should only be used for testing.
2011 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 2024 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
2012 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) { 2025 if (command_line.HasSwitch(switches::kEnableGpuBenchmarking)) {
2013 gfx::Rect view_bounds = GetView()->GetViewBounds(); 2026 gfx::Rect view_bounds = GetView()->GetViewBounds();
2014 gfx::Rect snapshot_bounds(view_bounds.size()); 2027 gfx::Rect snapshot_bounds(view_bounds.size());
2015 gfx::Size snapshot_size = snapshot_bounds.size(); 2028 gfx::Size snapshot_size = snapshot_bounds.size();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 is_waiting_for_beforeunload_ack_ = false; 2064 is_waiting_for_beforeunload_ack_ = false;
2052 is_waiting_for_unload_ack_ = false; 2065 is_waiting_for_unload_ack_ = false;
2053 has_timed_out_on_unload_ = false; 2066 has_timed_out_on_unload_ = false;
2054 } 2067 }
2055 2068
2056 void RenderViewHostImpl::ClearPowerSaveBlockers() { 2069 void RenderViewHostImpl::ClearPowerSaveBlockers() {
2057 STLDeleteValues(&power_save_blockers_); 2070 STLDeleteValues(&power_save_blockers_);
2058 } 2071 }
2059 2072
2060 } // namespace content 2073 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698