Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h

Issue 9649013: Show a different icon in the launcher for incognito windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-upload Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 25 matching lines...) Expand all
36 public ash::LauncherModelObserver, 36 public ash::LauncherModelObserver,
37 public content::NotificationObserver { 37 public content::NotificationObserver {
38 public: 38 public:
39 // Indicates what should happen when the app is launched. 39 // Indicates what should happen when the app is launched.
40 enum AppType { 40 enum AppType {
41 APP_TYPE_WINDOW, 41 APP_TYPE_WINDOW,
42 APP_TYPE_PANEL, 42 APP_TYPE_PANEL,
43 APP_TYPE_TAB 43 APP_TYPE_TAB
44 }; 44 };
45 45
46 // Indicates if a launcher item is incognito or not.
47 enum IncognitoState {
48 STATE_INCOGNITO,
49 STATE_NOT_INCOGNITO,
50 };
51
46 // Interface used to load app icons. This is in it's own class so that it can 52 // Interface used to load app icons. This is in it's own class so that it can
47 // be mocked. 53 // be mocked.
48 class AppIconLoader { 54 class AppIconLoader {
49 public: 55 public:
50 virtual ~AppIconLoader() {} 56 virtual ~AppIconLoader() {}
51 57
52 // Returns the app id of the specified tab, or an empty string if there is 58 // Returns the app id of the specified tab, or an empty string if there is
53 // no app. 59 // no app.
54 virtual std::string GetAppID(TabContentsWrapper* tab) = 0; 60 virtual std::string GetAppID(TabContentsWrapper* tab) = 0;
55 61
(...skipping 12 matching lines...) Expand all
68 // Initializes this ChromeLauncherDelegate. 74 // Initializes this ChromeLauncherDelegate.
69 void Init(); 75 void Init();
70 76
71 // Returns the single ChromeLauncherDelegate instnace. 77 // Returns the single ChromeLauncherDelegate instnace.
72 static ChromeLauncherDelegate* instance() { return instance_; } 78 static ChromeLauncherDelegate* instance() { return instance_; }
73 79
74 // Registers the prefs used by ChromeLauncherDelegate. 80 // Registers the prefs used by ChromeLauncherDelegate.
75 static void RegisterUserPrefs(PrefService* user_prefs); 81 static void RegisterUserPrefs(PrefService* user_prefs);
76 82
77 // Creates a new tabbed item on the launcher for |updater|. 83 // Creates a new tabbed item on the launcher for |updater|.
78 ash::LauncherID CreateTabbedLauncherItem(LauncherUpdater* updater); 84 ash::LauncherID CreateTabbedLauncherItem(LauncherUpdater* updater,
85 IncognitoState is_incognito);
79 86
80 // Creates a new app item on the launcher for |updater|. If there is an 87 // Creates a new app item on the launcher for |updater|. If there is an
81 // existing pinned app that isn't running on the launcher, its id is returned. 88 // existing pinned app that isn't running on the launcher, its id is returned.
82 ash::LauncherID CreateAppLauncherItem(LauncherUpdater* updater, 89 ash::LauncherID CreateAppLauncherItem(LauncherUpdater* updater,
83 const std::string& app_id, 90 const std::string& app_id,
84 AppType app_type, 91 AppType app_type,
85 ash::LauncherItemStatus status); 92 ash::LauncherItemStatus status);
86 93
87 // Updates the running status of an item. 94 // Updates the running status of an item.
88 void SetItemStatus(ash::LauncherID id, ash::LauncherItemStatus status); 95 void SetItemStatus(ash::LauncherID id, ash::LauncherItemStatus status);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 230
224 // Used to load the image for an app tab. 231 // Used to load the image for an app tab.
225 scoped_ptr<AppIconLoader> app_icon_loader_; 232 scoped_ptr<AppIconLoader> app_icon_loader_;
226 233
227 content::NotificationRegistrar registrar_; 234 content::NotificationRegistrar registrar_;
228 235
229 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherDelegate); 236 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherDelegate);
230 }; 237 };
231 238
232 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_DELEGATE_H_ 239 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_DELEGATE_H_
OLDNEW
« no previous file with comments | « ash/shell/shell_main.cc ('k') | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698