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

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

Issue 9316073: Expose contextual menu state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: shared linux build fix Created 8 years, 10 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 (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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" 9 #include "chrome/browser/tab_contents/render_view_context_menu.h"
10 10
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 return handlers; 1846 return handlers;
1847 } 1847 }
1848 1848
1849 void RenderViewContextMenu::MenuWillShow(ui::SimpleMenuModel* source) { 1849 void RenderViewContextMenu::MenuWillShow(ui::SimpleMenuModel* source) {
1850 // Ignore notifications from submenus. 1850 // Ignore notifications from submenus.
1851 if (source != &menu_model_) 1851 if (source != &menu_model_)
1852 return; 1852 return;
1853 1853
1854 RenderWidgetHostView* view = source_web_contents_->GetRenderWidgetHostView(); 1854 RenderWidgetHostView* view = source_web_contents_->GetRenderWidgetHostView();
1855 if (view) 1855 if (view)
1856 view->ShowingContextMenu(true); 1856 view->SetShowingContextMenu(true);
1857 } 1857 }
1858 1858
1859 void RenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) { 1859 void RenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) {
1860 // Ignore notifications from submenus. 1860 // Ignore notifications from submenus.
1861 if (source != &menu_model_) 1861 if (source != &menu_model_)
1862 return; 1862 return;
1863 1863
1864 RenderWidgetHostView* view = source_web_contents_->GetRenderWidgetHostView(); 1864 RenderWidgetHostView* view = source_web_contents_->GetRenderWidgetHostView();
1865 if (view) 1865 if (view)
1866 view->ShowingContextMenu(false); 1866 view->SetShowingContextMenu(false);
1867 RenderViewHost* rvh = source_web_contents_->GetRenderViewHost(); 1867 RenderViewHost* rvh = source_web_contents_->GetRenderViewHost();
1868 if (rvh) { 1868 if (rvh) {
1869 rvh->NotifyContextMenuClosed(params_.custom_context); 1869 rvh->NotifyContextMenuClosed(params_.custom_context);
1870 } 1870 }
1871 } 1871 }
1872 1872
1873 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { 1873 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
1874 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { 1874 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) {
1875 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1875 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1876 TabContentsWrapper* tab_contents_wrapper = 1876 TabContentsWrapper* tab_contents_wrapper =
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 source_web_contents_->GetRenderViewHost()-> 1945 source_web_contents_->GetRenderViewHost()->
1946 ExecuteMediaPlayerActionAtLocation(location, action); 1946 ExecuteMediaPlayerActionAtLocation(location, action);
1947 } 1947 }
1948 1948
1949 void RenderViewContextMenu::PluginActionAt( 1949 void RenderViewContextMenu::PluginActionAt(
1950 const gfx::Point& location, 1950 const gfx::Point& location,
1951 const WebPluginAction& action) { 1951 const WebPluginAction& action) {
1952 source_web_contents_->GetRenderViewHost()-> 1952 source_web_contents_->GetRenderViewHost()->
1953 ExecutePluginActionAtLocation(location, action); 1953 ExecutePluginActionAtLocation(location, action);
1954 } 1954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698