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 "ash/launcher/launcher_util.h" | 7 #include "ash/launcher/launcher_util.h" |
8 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 8 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" | 9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" |
10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 : LauncherItemController(type, app_id, controller), | 38 : LauncherItemController(type, app_id, controller), |
39 app_launcher_id_(app_launcher_id) { | 39 app_launcher_id_(app_launcher_id) { |
40 } | 40 } |
41 | 41 |
42 ShellWindowLauncherItemController::~ShellWindowLauncherItemController() { | 42 ShellWindowLauncherItemController::~ShellWindowLauncherItemController() { |
43 } | 43 } |
44 | 44 |
45 void ShellWindowLauncherItemController::AddShellWindow( | 45 void ShellWindowLauncherItemController::AddShellWindow( |
46 ShellWindow* shell_window, | 46 ShellWindow* shell_window, |
47 ash::LauncherItemStatus status) { | 47 ash::LauncherItemStatus status) { |
48 if (shell_window->window_type() == ShellWindow::WINDOW_TYPE_PANEL && | 48 if (shell_window->window_type_is_panel() && type() != TYPE_APP_PANEL) { |
49 type() != TYPE_APP_PANEL) { | |
50 LOG(ERROR) << "ShellWindow of type Panel added to non-panel launcher item"; | 49 LOG(ERROR) << "ShellWindow of type Panel added to non-panel launcher item"; |
51 } | 50 } |
52 if (status == ash::STATUS_ACTIVE) | 51 if (status == ash::STATUS_ACTIVE) |
53 shell_windows_.push_front(shell_window); | 52 shell_windows_.push_front(shell_window); |
54 else | 53 else |
55 shell_windows_.push_back(shell_window); | 54 shell_windows_.push_back(shell_window); |
56 } | 55 } |
57 | 56 |
58 void ShellWindowLauncherItemController::RemoveShellWindowForWindow( | 57 void ShellWindowLauncherItemController::RemoveShellWindowForWindow( |
59 aura::Window* window) { | 58 aura::Window* window) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 189 |
191 void ShellWindowLauncherItemController::RestoreOrShow( | 190 void ShellWindowLauncherItemController::RestoreOrShow( |
192 ShellWindow* shell_window) { | 191 ShellWindow* shell_window) { |
193 if (shell_window->GetBaseWindow()->IsMinimized()) | 192 if (shell_window->GetBaseWindow()->IsMinimized()) |
194 shell_window->GetBaseWindow()->Restore(); | 193 shell_window->GetBaseWindow()->Restore(); |
195 else | 194 else |
196 shell_window->GetBaseWindow()->Show(); | 195 shell_window->GetBaseWindow()->Show(); |
197 // Always activate windows when shown from the launcher. | 196 // Always activate windows when shown from the launcher. |
198 shell_window->GetBaseWindow()->Activate(); | 197 shell_window->GetBaseWindow()->Activate(); |
199 } | 198 } |
OLD | NEW |