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

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: Code review fix 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 703c5a8793fbad62f83fb49ad4e152a268ecde0d..af15efc410a636918c3e94a3ebddd0c624a4480b 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);
model_->Add(index, item);
DCHECK(id_to_item_map_.find(id) == id_to_item_map_.end());
id_to_item_map_[id].item_type = TYPE_TABBED_BROWSER;
@@ -180,7 +183,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);
model_->Add(insert_index, item);
DCHECK(id_to_item_map_.find(id) == id_to_item_map_.end());
@@ -213,7 +218,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