OLD | NEW |
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_tab.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h" |
6 | 6 |
7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
8 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 8 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 int index = tab_strip->GetIndexOfWebContents(web_contents()); | 42 int index = tab_strip->GetIndexOfWebContents(web_contents()); |
43 DCHECK_NE(index, TabStripModel::kNoTab); | 43 DCHECK_NE(index, TabStripModel::kNoTab); |
44 if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) { | 44 if (event_flags & (ui::EF_SHIFT_DOWN | ui::EF_MIDDLE_MOUSE_BUTTON)) { |
45 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_USER_GESTURE); | 45 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_USER_GESTURE); |
46 } else { | 46 } else { |
47 // In ChromeOS multiprofile scenario we might need to teleport the window | 47 // In ChromeOS multiprofile scenario we might need to teleport the window |
48 // back to the current user desktop. | 48 // back to the current user desktop. |
49 multi_user_util::MoveWindowToCurrentDesktop( | 49 multi_user_util::MoveWindowToCurrentDesktop( |
50 browser->window()->GetNativeWindow()); | 50 browser->window()->GetNativeWindow()); |
51 tab_strip->ActivateTabAt(index, false); | 51 tab_strip->ActivateTabAt(index, false); |
52 browser->window()->Show(); | 52 browser->window()->Show(true /* user_gesture */); |
53 // Need this check to prevent unit tests from crashing. | 53 // Need this check to prevent unit tests from crashing. |
54 if (browser->window()->GetNativeWindow()) | 54 if (browser->window()->GetNativeWindow()) |
55 ash::wm::ActivateWindow(browser->window()->GetNativeWindow()); | 55 ash::wm::ActivateWindow(browser->window()->GetNativeWindow()); |
56 } | 56 } |
57 } | 57 } |
OLD | NEW |