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

Unified Diff: chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc

Issue 178193005: Move render_view_context_menu.* related files out of tab_contents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: context_menu->renderer_context_menu for disambiguation Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/tab_contents/render_view_context_menu_win.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
deleted file mode 100644
index e3f0809309dbce83374e72c1a7438284fb8a59bd..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_win.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/views/tab_contents/render_view_context_menu_win.h"
-
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/tab_contents/retargeting_details.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "content/public/browser/web_contents.h"
-#include "win8/util/win8_util.h"
-
-using content::WebContents;
-
-RenderViewContextMenuWin::RenderViewContextMenuWin(
- content::RenderFrameHost* render_frame_host,
- const content::ContextMenuParams& params)
- : RenderViewContextMenuViews(render_frame_host, params) {
-}
-
-RenderViewContextMenuWin::~RenderViewContextMenuWin() {
-}
-
-// static
-RenderViewContextMenuViews* RenderViewContextMenuViews::Create(
- content::RenderFrameHost* render_frame_host,
- const content::ContextMenuParams& params) {
- return new RenderViewContextMenuWin(render_frame_host, params);
-}
-
-bool RenderViewContextMenuWin::IsCommandIdVisible(int command_id) const {
- // In windows 8 metro mode no new window option on normal browser windows.
- if (win8::IsSingleWindowMetroMode() && !profile_->IsOffTheRecord() &&
- command_id == IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW) {
- return false;
- }
- return RenderViewContextMenu::IsCommandIdVisible(command_id);
-}
-
-void RenderViewContextMenuWin::ExecuteCommand(int command_id,
- int event_flags) {
- if (win8::IsSingleWindowMetroMode() &&
- command_id == IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW) {
- // The open link in new window command should only be enabled for
- // incognito windows in metro mode.
- DCHECK(profile_->IsOffTheRecord());
- // We directly go to the Browser object to open the url in effect
- // bypassing the delegate. Currently the Browser is the only class which
- // implements the delegate for the context menu. This would break if there
- // are other delegates for the context menu. This is ok for now as this
- // code only executes for Windows 8 metro mode.
- // TODO(robertshield): FTB - Switch this to HOST_DESKTOP_TYPE_ASH when
- // we make that the default for metro.
- Browser* browser =
- chrome::FindTabbedBrowser(profile_->GetOriginalProfile(),
- false,
- chrome::HOST_DESKTOP_TYPE_NATIVE);
- if (browser) {
- content::OpenURLParams url_params(
- params_.link_url,
- content::Referrer(params_.frame_url.is_empty() ?
- params_.page_url : params_.frame_url,
- params_.referrer_policy),
- NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK,
- false);
- WebContents* source_web_contents =
- browser->tab_strip_model()->GetActiveWebContents();
- WebContents* new_contents = source_web_contents->OpenURL(url_params);
- DCHECK(new_contents);
- return;
- }
- }
- RenderViewContextMenu::ExecuteCommand(command_id, event_flags);
-}
« no previous file with comments | « chrome/browser/ui/views/tab_contents/render_view_context_menu_win.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698