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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 gfx::Size(kImageSearchThumbnailMaxWidth, 2026 gfx::Size(kImageSearchThumbnailMaxWidth,
2027 kImageSearchThumbnailMaxHeight))); 2027 kImageSearchThumbnailMaxHeight)));
2028 } 2028 }
2029 2029
2030 void RenderViewContextMenu::Inspect(int x, int y) { 2030 void RenderViewContextMenu::Inspect(int x, int y) {
2031 content::RecordAction(UserMetricsAction("DevTools_InspectElement")); 2031 content::RecordAction(UserMetricsAction("DevTools_InspectElement"));
2032 RenderFrameHost* render_frame_host = 2032 RenderFrameHost* render_frame_host =
2033 RenderFrameHost::FromID(render_process_id_, render_frame_id_); 2033 RenderFrameHost::FromID(render_process_id_, render_frame_id_);
2034 if (!render_frame_host) 2034 if (!render_frame_host)
2035 return; 2035 return;
2036 DevToolsWindow::InspectElement(render_frame_host->GetRenderViewHost(), x, y); 2036 DevToolsWindow::InspectElement(
2037 WebContents::FromRenderFrameHost(render_frame_host), x, y);
2037 } 2038 }
2038 2039
2039 void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { 2040 void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) {
2040 chrome_common_net::WriteURLToClipboard( 2041 chrome_common_net::WriteURLToClipboard(
2041 url, 2042 url,
2042 GetPrefs(browser_context_)->GetString(prefs::kAcceptLanguages), 2043 GetPrefs(browser_context_)->GetString(prefs::kAcceptLanguages),
2043 ui::Clipboard::GetForCurrentThread()); 2044 ui::Clipboard::GetForCurrentThread());
2044 } 2045 }
2045 2046
2046 void RenderViewContextMenu::MediaPlayerActionAt( 2047 void RenderViewContextMenu::MediaPlayerActionAt(
2047 const gfx::Point& location, 2048 const gfx::Point& location,
2048 const WebMediaPlayerAction& action) { 2049 const WebMediaPlayerAction& action) {
2049 source_web_contents_->GetRenderViewHost()-> 2050 source_web_contents_->GetRenderViewHost()->
2050 ExecuteMediaPlayerActionAtLocation(location, action); 2051 ExecuteMediaPlayerActionAtLocation(location, action);
2051 } 2052 }
2052 2053
2053 void RenderViewContextMenu::PluginActionAt( 2054 void RenderViewContextMenu::PluginActionAt(
2054 const gfx::Point& location, 2055 const gfx::Point& location,
2055 const WebPluginAction& action) { 2056 const WebPluginAction& action) {
2056 source_web_contents_->GetRenderViewHost()-> 2057 source_web_contents_->GetRenderViewHost()->
2057 ExecutePluginActionAtLocation(location, action); 2058 ExecutePluginActionAtLocation(location, action);
2058 } 2059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698