| 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_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class PrefService; | 31 class PrefService; |
| 32 class Profile; | 32 class Profile; |
| 33 class TabContentsWrapper; | 33 class TabContentsWrapper; |
| 34 | 34 |
| 35 // ChromeLauncherController manages the launcher items needed for tabbed | 35 // ChromeLauncherController manages the launcher items needed for tabbed |
| 36 // browsers (BrowserLauncherItemController) and browser shortcuts. | 36 // browsers (BrowserLauncherItemController) and browser shortcuts. |
| 37 class ChromeLauncherController : public ash::LauncherDelegate, | 37 class ChromeLauncherController : public ash::LauncherDelegate, |
| 38 public ash::LauncherModelObserver, | 38 public ash::LauncherModelObserver, |
| 39 public content::NotificationObserver { | 39 public content::NotificationObserver { |
| 40 public: | 40 public: |
| 41 // Path within the dictionary entries in the prefs::kPinnedLauncherApps list | |
| 42 // specifying the extension ID of the app to be pinned by that entry. | |
| 43 static const char kPinnedAppsPrefAppIDPath[]; | |
| 44 | |
| 45 // Indicates if a launcher item is incognito or not. | 41 // Indicates if a launcher item is incognito or not. |
| 46 enum IncognitoState { | 42 enum IncognitoState { |
| 47 STATE_INCOGNITO, | 43 STATE_INCOGNITO, |
| 48 STATE_NOT_INCOGNITO, | 44 STATE_NOT_INCOGNITO, |
| 49 }; | 45 }; |
| 50 | 46 |
| 51 // Interface used to load app icons. This is in it's own class so that it can | 47 // Interface used to load app icons. This is in it's own class so that it can |
| 52 // be mocked. | 48 // be mocked. |
| 53 class AppIconLoader { | 49 class AppIconLoader { |
| 54 public: | 50 public: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 69 | 65 |
| 70 ChromeLauncherController(Profile* profile, ash::LauncherModel* model); | 66 ChromeLauncherController(Profile* profile, ash::LauncherModel* model); |
| 71 virtual ~ChromeLauncherController(); | 67 virtual ~ChromeLauncherController(); |
| 72 | 68 |
| 73 // Initializes this ChromeLauncherController. | 69 // Initializes this ChromeLauncherController. |
| 74 void Init(); | 70 void Init(); |
| 75 | 71 |
| 76 // Returns the single ChromeLauncherController instnace. | 72 // Returns the single ChromeLauncherController instnace. |
| 77 static ChromeLauncherController* instance() { return instance_; } | 73 static ChromeLauncherController* instance() { return instance_; } |
| 78 | 74 |
| 79 // Registers the prefs used by ChromeLauncherController. | |
| 80 static void RegisterUserPrefs(PrefService* user_prefs); | |
| 81 | |
| 82 // Creates a new tabbed item on the launcher for |updater|. | 75 // Creates a new tabbed item on the launcher for |updater|. |
| 83 ash::LauncherID CreateTabbedLauncherItem( | 76 ash::LauncherID CreateTabbedLauncherItem( |
| 84 BrowserLauncherItemController* controller, | 77 BrowserLauncherItemController* controller, |
| 85 IncognitoState is_incognito, | 78 IncognitoState is_incognito, |
| 86 ash::LauncherItemStatus status); | 79 ash::LauncherItemStatus status); |
| 87 | 80 |
| 88 // Creates a new app item on the launcher for |updater|. If there is an | 81 // Creates a new app item on the launcher for |updater|. If there is an |
| 89 // existing pinned app that isn't running on the launcher, its id is returned. | 82 // existing pinned app that isn't running on the launcher, its id is returned. |
| 90 ash::LauncherID CreateAppLauncherItem( | 83 ash::LauncherID CreateAppLauncherItem( |
| 91 BrowserLauncherItemController* controller, | 84 BrowserLauncherItemController* controller, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 std::deque<Item> pending_pinned_apps_; | 253 std::deque<Item> pending_pinned_apps_; |
| 261 | 254 |
| 262 content::NotificationRegistrar notification_registrar_; | 255 content::NotificationRegistrar notification_registrar_; |
| 263 | 256 |
| 264 PrefChangeRegistrar pref_change_registrar_; | 257 PrefChangeRegistrar pref_change_registrar_; |
| 265 | 258 |
| 266 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 259 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 267 }; | 260 }; |
| 268 | 261 |
| 269 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 262 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |