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

Unified Diff: chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
diff --git a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
index 134a37e6fa95b551abbd876d7adfe381542ee455..7b2b99b0183b8824531a72f2e0df9d0bbfac9f75 100644
--- a/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
+++ b/chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc
@@ -122,7 +122,8 @@ void ChromeLauncherDelegate::RegisterUserPrefs(PrefService* user_prefs) {
}
ash::LauncherID ChromeLauncherDelegate::CreateTabbedLauncherItem(
- LauncherUpdater* updater) {
+ LauncherUpdater* updater,
+ IncognitoState is_incognito) {
// Tabbed items always get a new item. Put the tabbed item before the app
// tabs. If there are no app tabs put it at the end.
int index = static_cast<int>(model_->items().size());
@@ -134,7 +135,9 @@ ash::LauncherID ChromeLauncherDelegate::CreateTabbedLauncherItem(
}
}
ash::LauncherID id = model_->next_id();
- ash::LauncherItem item(ash::TYPE_TABBED);
+ ash::LauncherItem item;
+ item.type = ash::TYPE_TABBED;
+ item.is_incognito = (is_incognito == STATE_INCOGNITO);
item.status = ash::STATUS_RUNNING;
model_->Add(index, item);
DCHECK(id_to_item_map_.find(id) == id_to_item_map_.end());
@@ -183,7 +186,9 @@ ash::LauncherID ChromeLauncherDelegate::CreateAppLauncherItem(
int insert_index = min_app_index != item_count ?
min_app_index : std::min(item_count, min_tab_index + 1);
ash::LauncherID id = model_->next_id();
- ash::LauncherItem item(ash::TYPE_APP);
+ ash::LauncherItem item;
+ item.type = ash::TYPE_APP;
+ item.is_incognito = false;
item.image = Extension::GetDefaultIcon(true);
item.status = status;
model_->Add(insert_index, item);
@@ -225,7 +230,9 @@ void ChromeLauncherDelegate::ConvertTabbedToApp(ash::LauncherID id,
id_to_item_map_[id].app_type = app_type;
id_to_item_map_[id].app_id = app_id;
- ash::LauncherItem item(ash::TYPE_APP);
+ ash::LauncherItem item;
+ item.type = ash::TYPE_APP;
+ item.is_incognito = false;
item.id = id;
model_->Set(model_->ItemIndexByID(id), item);

Powered by Google App Engine
This is Rietveld 408576698