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/shell_window_launcher_item_controller.h
" | 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
" |
6 | 6 |
| 7 #include "apps/shell_window.h" |
7 #include "ash/wm/window_properties.h" | 8 #include "ash/wm/window_properties.h" |
8 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" | 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" |
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h" | 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h" |
13 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
14 #include "chrome/browser/ui/extensions/native_app_window.h" | 15 #include "chrome/browser/ui/extensions/native_app_window.h" |
15 #include "chrome/browser/ui/extensions/shell_window.h" | |
16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
17 #include "ui/aura/client/aura_constants.h" | 17 #include "ui/aura/client/aura_constants.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/base/events/event.h" | 19 #include "ui/base/events/event.h" |
20 #include "ui/views/corewm/window_animations.h" | 20 #include "ui/views/corewm/window_animations.h" |
21 | 21 |
| 22 using apps::ShellWindow; |
| 23 |
22 namespace { | 24 namespace { |
23 | 25 |
24 // Functor for std::find_if used in AppLauncherItemController. | 26 // Functor for std::find_if used in AppLauncherItemController. |
25 class ShellWindowHasWindow { | 27 class ShellWindowHasWindow { |
26 public: | 28 public: |
27 explicit ShellWindowHasWindow(aura::Window* window) : window_(window) { } | 29 explicit ShellWindowHasWindow(aura::Window* window) : window_(window) { } |
28 | 30 |
29 bool operator()(ShellWindow* shell_window) const { | 31 bool operator()(ShellWindow* shell_window) const { |
30 return shell_window->GetNativeWindow() == window_; | 32 return shell_window->GetNativeWindow() == window_; |
31 } | 33 } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 253 } |
252 if (window_to_show->GetBaseWindow()->IsActive()) { | 254 if (window_to_show->GetBaseWindow()->IsActive()) { |
253 // Coming here, only a single window is active. For keyboard activations | 255 // Coming here, only a single window is active. For keyboard activations |
254 // the window gets animated. | 256 // the window gets animated. |
255 AnimateWindow(window_to_show->GetNativeWindow(), | 257 AnimateWindow(window_to_show->GetNativeWindow(), |
256 views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); | 258 views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); |
257 } else { | 259 } else { |
258 ShowAndActivateOrMinimize(window_to_show); | 260 ShowAndActivateOrMinimize(window_to_show); |
259 } | 261 } |
260 } | 262 } |
OLD | NEW |