| 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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 12 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 13 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 14 | 15 |
| 15 namespace aura { | 16 namespace aura { |
| 16 class Window; | 17 class Window; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Image; | 21 class Image; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 72 |
| 72 // Get the number of running applications/incarnations of this. | 73 // Get the number of running applications/incarnations of this. |
| 73 size_t shell_window_count() const { return shell_windows_.size(); } | 74 size_t shell_window_count() const { return shell_windows_.size(); } |
| 74 | 75 |
| 75 // Activates the window at position |index|. | 76 // Activates the window at position |index|. |
| 76 void ActivateIndexedApp(size_t index); | 77 void ActivateIndexedApp(size_t index); |
| 77 | 78 |
| 78 private: | 79 private: |
| 79 typedef std::list<ShellWindow*> ShellWindowList; | 80 typedef std::list<ShellWindow*> ShellWindowList; |
| 80 | 81 |
| 81 // Get the title of the running application with this |index|. | |
| 82 string16 GetTitleOfIndexedApp(size_t index); | |
| 83 | |
| 84 // Get the title of the running application with this |index|. | |
| 85 // Note that the returned image needs to be released by the caller. | |
| 86 gfx::Image* GetIconOfIndexedApp(size_t index); | |
| 87 | |
| 88 void RestoreOrShow(ShellWindow* shell_window); | 82 void RestoreOrShow(ShellWindow* shell_window); |
| 89 | 83 |
| 90 // List of associated shell windows in activation order. | 84 // List of associated shell windows |
| 91 ShellWindowList shell_windows_; | 85 ShellWindowList shell_windows_; |
| 92 | 86 |
| 87 // Pointer to the most recently active shell window |
| 88 ShellWindow* last_active_shell_window_; |
| 89 |
| 93 // The launcher id associated with this set of windows. There is one | 90 // The launcher id associated with this set of windows. There is one |
| 94 // AppLauncherItemController for each |app_launcher_id_|. | 91 // AppLauncherItemController for each |app_launcher_id_|. |
| 95 const std::string app_launcher_id_; | 92 const std::string app_launcher_id_; |
| 96 | 93 |
| 97 // Scoped list of observed windows (for removal on destruction) | 94 // Scoped list of observed windows (for removal on destruction) |
| 98 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; | 95 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
| 99 | 96 |
| 100 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherItemController); | 97 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherItemController); |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_
H_ | 100 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_ITEM_CONTROLLER_
H_ |
| OLD | NEW |