| 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_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h" | |
| 12 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 11 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 12 #include "url/gurl.h" |
| 13 |
| 14 class URLPattern; |
| 13 | 15 |
| 14 namespace aura { | 16 namespace aura { |
| 15 class Window; | 17 class Window; |
| 16 } | 18 } |
| 17 | 19 |
| 18 namespace extensions { | 20 namespace extensions { |
| 19 class Extension; | 21 class Extension; |
| 20 } | 22 } |
| 21 | 23 |
| 22 class ChromeLauncherController; | 24 class ChromeLauncherController; |
| 23 | 25 |
| 24 // Item controller for an app shortcut. Shortcuts track app and launcher ids, | 26 // Item controller for an app shortcut. Shortcuts track app and launcher ids, |
| 25 // but do not have any associated windows (opening a shortcut will replace the | 27 // but do not have any associated windows (opening a shortcut will replace the |
| 26 // item with the appropriate LauncherItemController type). | 28 // item with the appropriate LauncherItemController type). |
| 27 class AppShortcutLauncherItemController : public LauncherItemController { | 29 class AppShortcutLauncherItemController : public LauncherItemController { |
| 28 public: | 30 public: |
| 29 AppShortcutLauncherItemController(const std::string& app_id, | 31 AppShortcutLauncherItemController(const std::string& app_id, |
| 30 ChromeLauncherControllerPerApp* controller); | 32 ChromeLauncherController* controller); |
| 31 | 33 |
| 32 virtual ~AppShortcutLauncherItemController(); | 34 virtual ~AppShortcutLauncherItemController(); |
| 33 | 35 |
| 34 // LauncherItemController overrides: | 36 // LauncherItemController overrides: |
| 35 virtual string16 GetTitle() OVERRIDE; | 37 virtual string16 GetTitle() OVERRIDE; |
| 36 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; | 38 virtual bool IsCurrentlyShownInWindow(aura::Window* window) const OVERRIDE; |
| 37 virtual bool IsOpen() const OVERRIDE; | 39 virtual bool IsOpen() const OVERRIDE; |
| 38 virtual bool IsVisible() const OVERRIDE; | 40 virtual bool IsVisible() const OVERRIDE; |
| 39 virtual void Launch(int event_flags) OVERRIDE; | 41 virtual void Launch(int event_flags) OVERRIDE; |
| 40 virtual void Activate() OVERRIDE; | 42 virtual void Activate() OVERRIDE; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // will return true if it has sucessfully advanced. | 74 // will return true if it has sucessfully advanced. |
| 73 bool AdvanceToNextApp(); | 75 bool AdvanceToNextApp(); |
| 74 | 76 |
| 75 // Returns true if the application is a V2 app. | 77 // Returns true if the application is a V2 app. |
| 76 bool IsV2App(); | 78 bool IsV2App(); |
| 77 | 79 |
| 78 // Returns true if it is allowed to try starting a V2 app again. | 80 // Returns true if it is allowed to try starting a V2 app again. |
| 79 bool AllowNextLaunchAttempt(); | 81 bool AllowNextLaunchAttempt(); |
| 80 | 82 |
| 81 GURL refocus_url_; | 83 GURL refocus_url_; |
| 82 ChromeLauncherControllerPerApp* app_controller_; | |
| 83 | 84 |
| 84 // Since V2 applications can be undetectable after launching, this timer is | 85 // Since V2 applications can be undetectable after launching, this timer is |
| 85 // keeping track of the last launch attempt. | 86 // keeping track of the last launch attempt. |
| 86 base::Time last_launch_attempt_; | 87 base::Time last_launch_attempt_; |
| 87 | 88 |
| 89 ChromeLauncherController* chrome_launcher_controller_; |
| 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); | 91 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ | 94 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_SHORTCUT_LAUNCHER_ITEM_CONTROLLER_
H_ |
| OLD | NEW |