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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc

Issue 2716403005: mash: Remove shelf app menu item objects. (Closed)
Patch Set: Address comments. Created 3 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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
deleted file mode 100644
index 956b6216a793b949a58091253d637f70ea185fba..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.cc
+++ /dev/null
@@ -1,44 +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/ash/launcher/chrome_launcher_app_menu_item_tab.h"
-
-#include "ash/wm/window_util.h"
-#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "ui/events/event_constants.h"
-
-ChromeLauncherAppMenuItemTab::ChromeLauncherAppMenuItemTab(
- const base::string16 title,
- const gfx::Image* icon,
- content::WebContents* content)
- : ash::ShelfApplicationMenuItem(title, icon),
- content::WebContentsObserver(content) {}
-
-void ChromeLauncherAppMenuItemTab::Execute(int event_flags) {
- if (!web_contents())
- return;
- Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
- if (!browser)
- return;
- TabStripModel* tab_strip = browser->tab_strip_model();
- int index = tab_strip->GetIndexOfWebContents(web_contents());
- DCHECK_NE(index, TabStripModel::kNoTab);
- if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) {
- tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_USER_GESTURE);
- } else {
- // In ChromeOS multiprofile scenario we might need to teleport the window
- // back to the current user desktop.
- multi_user_util::MoveWindowToCurrentDesktop(
- browser->window()->GetNativeWindow());
- tab_strip->ActivateTabAt(index, false);
- browser->window()->Show();
- // Need this check to prevent unit tests from crashing.
- if (browser->window()->GetNativeWindow())
- ash::wm::ActivateWindow(browser->window()->GetNativeWindow());
- }
-}

Powered by Google App Engine
This is Rietveld 408576698