| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 ShellWindow* shell_window = *iter; | 72 ShellWindow* shell_window = *iter; |
| 73 shell_windows_.erase(iter); | 73 shell_windows_.erase(iter); |
| 74 shell_windows_.push_front(shell_window); | 74 shell_windows_.push_front(shell_window); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 string16 ShellWindowLauncherItemController::GetTitle() { | 78 string16 ShellWindowLauncherItemController::GetTitle() { |
| 79 return GetAppTitle(); | 79 return GetAppTitle(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool ShellWindowLauncherItemController::HasWindow( | 82 bool ShellWindowLauncherItemController::HasWindow(aura::Window* window) const { |
| 83 aura::Window* window) const { | |
| 84 ShellWindowList::const_iterator iter = | 83 ShellWindowList::const_iterator iter = |
| 85 std::find_if(shell_windows_.begin(), shell_windows_.end(), | 84 std::find_if(shell_windows_.begin(), shell_windows_.end(), |
| 86 ShellWindowHasWindow(window)); | 85 ShellWindowHasWindow(window)); |
| 87 return iter != shell_windows_.end(); | 86 return iter != shell_windows_.end(); |
| 88 } | 87 } |
| 89 | 88 |
| 90 bool ShellWindowLauncherItemController::IsOpen() const { | 89 bool ShellWindowLauncherItemController::IsOpen() const { |
| 91 return !shell_windows_.empty(); | 90 return !shell_windows_.empty(); |
| 92 } | 91 } |
| 93 | 92 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 void ShellWindowLauncherItemController::RestoreOrShow( | 189 void ShellWindowLauncherItemController::RestoreOrShow( |
| 191 ShellWindow* shell_window) { | 190 ShellWindow* shell_window) { |
| 192 if (shell_window->GetBaseWindow()->IsMinimized()) | 191 if (shell_window->GetBaseWindow()->IsMinimized()) |
| 193 shell_window->GetBaseWindow()->Restore(); | 192 shell_window->GetBaseWindow()->Restore(); |
| 194 else | 193 else |
| 195 shell_window->GetBaseWindow()->Show(); | 194 shell_window->GetBaseWindow()->Show(); |
| 196 // Always activate windows when shown from the launcher. | 195 // Always activate windows when shown from the launcher. |
| 197 shell_window->GetBaseWindow()->Activate(); | 196 shell_window->GetBaseWindow()->Activate(); |
| 198 } | 197 } |
| OLD | NEW |