| 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_CHROME_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/launcher/launcher_delegate.h" | 10 #include "ash/launcher/launcher_delegate.h" |
| 11 #include "ash/launcher/launcher_types.h" | 11 #include "ash/launcher/launcher_types.h" |
| 12 #include "ash/shelf_types.h" | 12 #include "ash/shelf_types.h" |
| 13 #include "chrome/browser/extensions/extension_prefs.h" | 13 #include "chrome/browser/extensions/extension_prefs.h" |
| 14 | 14 |
| 15 class BrowserLauncherItemControllerTest; | 15 class BrowserLauncherItemControllerTest; |
| 16 class LauncherItemController; | 16 class LauncherItemController; |
| 17 class Profile; | 17 class Profile; |
| 18 class TabContents; | |
| 19 | 18 |
| 20 namespace ash { | 19 namespace ash { |
| 21 class LauncherModel; | 20 class LauncherModel; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace aura { | 23 namespace aura { |
| 25 class Window; | 24 class Window; |
| 26 class RootWindow; | 25 class RootWindow; |
| 27 } | 26 } |
| 28 | 27 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 // * Shortcuts have no LauncherItemController. | 41 // * Shortcuts have no LauncherItemController. |
| 43 class ChromeLauncherController | 42 class ChromeLauncherController |
| 44 : public ash::LauncherDelegate { | 43 : public ash::LauncherDelegate { |
| 45 public: | 44 public: |
| 46 // Indicates if a launcher item is incognito or not. | 45 // Indicates if a launcher item is incognito or not. |
| 47 enum IncognitoState { | 46 enum IncognitoState { |
| 48 STATE_INCOGNITO, | 47 STATE_INCOGNITO, |
| 49 STATE_NOT_INCOGNITO, | 48 STATE_NOT_INCOGNITO, |
| 50 }; | 49 }; |
| 51 | 50 |
| 52 // Used to update the state of non plaform apps, as tab contents change. | 51 // Used to update the state of non plaform apps, as web contents change. |
| 53 enum AppState { | 52 enum AppState { |
| 54 APP_STATE_ACTIVE, | 53 APP_STATE_ACTIVE, |
| 55 APP_STATE_WINDOW_ACTIVE, | 54 APP_STATE_WINDOW_ACTIVE, |
| 56 APP_STATE_INACTIVE, | 55 APP_STATE_INACTIVE, |
| 57 APP_STATE_REMOVED | 56 APP_STATE_REMOVED |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 // Mockable interface to get app ids from tabs. | 59 // Mockable interface to get app ids from tabs. |
| 61 class AppTabHelper { | 60 class AppTabHelper { |
| 62 public: | 61 public: |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Returns |true| if the user is allowed to modify the shelf auto-hide | 222 // Returns |true| if the user is allowed to modify the shelf auto-hide |
| 224 // behavior on |root_window|. | 223 // behavior on |root_window|. |
| 225 virtual bool CanUserModifyShelfAutoHideBehavior( | 224 virtual bool CanUserModifyShelfAutoHideBehavior( |
| 226 aura::RootWindow* root_window) const = 0; | 225 aura::RootWindow* root_window) const = 0; |
| 227 | 226 |
| 228 // Toggles the shelf auto-hide behavior on |root_window|. Does nothing if the | 227 // Toggles the shelf auto-hide behavior on |root_window|. Does nothing if the |
| 229 // user is not allowed to modify the auto-hide behavior. | 228 // user is not allowed to modify the auto-hide behavior. |
| 230 virtual void ToggleShelfAutoHideBehavior(aura::RootWindow* root_window) = 0; | 229 virtual void ToggleShelfAutoHideBehavior(aura::RootWindow* root_window) = 0; |
| 231 | 230 |
| 232 // The tab no longer represents its previously identified application. | 231 // The tab no longer represents its previously identified application. |
| 233 virtual void RemoveTabFromRunningApp(TabContents* tab, | 232 virtual void RemoveTabFromRunningApp(content::WebContents* tab, |
| 234 const std::string& app_id) = 0; | 233 const std::string& app_id) = 0; |
| 235 | 234 |
| 236 // Notify the controller that the state of an non platform app's tabs | 235 // Notify the controller that the state of an non platform app's tabs |
| 237 // have changed, | 236 // have changed, |
| 238 virtual void UpdateAppState(content::WebContents* contents, | 237 virtual void UpdateAppState(content::WebContents* contents, |
| 239 AppState app_state) = 0; | 238 AppState app_state) = 0; |
| 240 | 239 |
| 241 // Limits application refocusing to urls that match |url| for |id|. | 240 // Limits application refocusing to urls that match |url| for |id|. |
| 242 virtual void SetRefocusURLPattern(ash::LauncherID id, const GURL& url) = 0; | 241 virtual void SetRefocusURLPattern(ash::LauncherID id, const GURL& url) = 0; |
| 243 | 242 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 272 virtual void SetAppTabHelperForTest(AppTabHelper* helper) = 0; | 271 virtual void SetAppTabHelperForTest(AppTabHelper* helper) = 0; |
| 273 virtual void SetAppIconLoaderForTest(AppIconLoader* loader) = 0; | 272 virtual void SetAppIconLoaderForTest(AppIconLoader* loader) = 0; |
| 274 virtual const std::string& GetAppIdFromLauncherIdForTest( | 273 virtual const std::string& GetAppIdFromLauncherIdForTest( |
| 275 ash::LauncherID id) = 0; | 274 ash::LauncherID id) = 0; |
| 276 | 275 |
| 277 private: | 276 private: |
| 278 static ChromeLauncherController* instance_; | 277 static ChromeLauncherController* instance_; |
| 279 }; | 278 }; |
| 280 | 279 |
| 281 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 280 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |