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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.cc

Issue 1158523002: Add user_gesture param to BaseWindow::Show Base URL: https://chromium.googlesource.com/chromium/src.git@ug3_BaseWindow_Activate
Patch Set: Update callers Created 5 years, 7 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 "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h " 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h "
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 9 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 29 matching lines...) Expand all
40 void ChromeLauncherAppMenuItemBrowser::Execute(int event_flags) { 40 void ChromeLauncherAppMenuItemBrowser::Execute(int event_flags) {
41 if (browser_) { 41 if (browser_) {
42 if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) { 42 if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) {
43 TabStripModel* tab_strip = browser_->tab_strip_model(); 43 TabStripModel* tab_strip = browser_->tab_strip_model();
44 tab_strip->CloseAllTabs(); 44 tab_strip->CloseAllTabs();
45 } else { 45 } else {
46 // In ChromeOS multiprofile scenario we might need to teleport the window 46 // In ChromeOS multiprofile scenario we might need to teleport the window
47 // back to the current user desktop. 47 // back to the current user desktop.
48 multi_user_util::MoveWindowToCurrentDesktop( 48 multi_user_util::MoveWindowToCurrentDesktop(
49 browser_->window()->GetNativeWindow()); 49 browser_->window()->GetNativeWindow());
50 browser_->window()->Show(); 50 browser_->window()->Show(true /* user_gesture */);
51 ash::wm::ActivateWindow(browser_->window()->GetNativeWindow()); 51 ash::wm::ActivateWindow(browser_->window()->GetNativeWindow());
52 } 52 }
53 } 53 }
54 } 54 }
55 55
56 void ChromeLauncherAppMenuItemBrowser::Observe( 56 void ChromeLauncherAppMenuItemBrowser::Observe(
57 int type, 57 int type,
58 const content::NotificationSource& source, 58 const content::NotificationSource& source,
59 const content::NotificationDetails& details) { 59 const content::NotificationDetails& details) {
60 switch (type) { 60 switch (type) {
61 case chrome::NOTIFICATION_BROWSER_CLOSING: 61 case chrome::NOTIFICATION_BROWSER_CLOSING:
62 DCHECK_EQ(browser_, content::Source<Browser>(source).ptr()); 62 DCHECK_EQ(browser_, content::Source<Browser>(source).ptr());
63 browser_ = NULL; 63 browser_ = NULL;
64 break; 64 break;
65 65
66 default: 66 default:
67 NOTREACHED(); 67 NOTREACHED();
68 } 68 }
69 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698