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

Unified Diff: chrome/browser/ui/views/ash/launcher/launcher_updater.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/launcher_updater.cc
diff --git a/chrome/browser/ui/views/ash/launcher/launcher_updater.cc b/chrome/browser/ui/views/ash/launcher/launcher_updater.cc
index 5b1fe229a781af3f542e8e29d4c40209c49f9ef2..0b056a87caeb6f4ee212f8d080d06862eae5cb20 100644
--- a/chrome/browser/ui/views/ash/launcher/launcher_updater.cc
+++ b/chrome/browser/ui/views/ash/launcher/launcher_updater.cc
@@ -38,7 +38,12 @@ LauncherUpdater::LauncherUpdater(aura::Window* window,
launcher_delegate_(delegate),
type_(type),
app_id_(app_id),
+ is_incognito_(false),
item_id_(-1) {
+ if (tab_model_->count() > 0) {
sky 2012/03/10 00:13:11 Use the profile from the TabStripModel, that way y
Zachary Kuznia 2012/03/10 00:28:36 Done.
+ TabContentsWrapper* tab = tab_model_->GetTabContentsAt(0);
+ is_incognito_ = (tab->profile()->GetOriginalProfile() != tab->profile());
+ }
}
LauncherUpdater::~LauncherUpdater() {
@@ -272,7 +277,9 @@ void LauncherUpdater::UpdateAppTabState(TabContentsWrapper* tab,
launcher_delegate_->LauncherItemClosed(launcher_id);
CreateTabbedItem();
}
- ash::LauncherItem item(ash::TYPE_TABBED);
+ ash::LauncherItem item;
+ item.type = ash::TYPE_TABBED;
+ item.is_incognito = is_incognito_;
item.num_tabs = tab_model_->count();
launcher_model()->Set(launcher_model()->ItemIndexByID(item_id_), item);
} else {
@@ -323,7 +330,10 @@ void LauncherUpdater::RegisterAppItem(ash::LauncherID id,
void LauncherUpdater::CreateTabbedItem() {
DCHECK_EQ(-1, item_id_);
- item_id_ = launcher_delegate_->CreateTabbedLauncherItem(this);
+ item_id_ = launcher_delegate_->CreateTabbedLauncherItem(
+ this,
+ is_incognito_ ? ChromeLauncherDelegate::STATE_INCOGNITO :
+ ChromeLauncherDelegate::STATE_NOT_INCOGNITO);
}
bool LauncherUpdater::ContainsID(ash::LauncherID id, TabContentsWrapper** tab) {

Powered by Google App Engine
This is Rietveld 408576698