| 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..37da3d9d2c3e3e3d6593a1419a7ca73ba437a90a 100644
|
| --- a/chrome/browser/ui/views/ash/launcher/launcher_updater.cc
|
| +++ b/chrome/browser/ui/views/ash/launcher/launcher_updater.cc
|
| @@ -59,16 +59,19 @@ void LauncherUpdater::Init() {
|
| item_id_ = launcher_delegate_->CreateAppLauncherItem(
|
| this, app_id_, app_type);
|
| } else {
|
| + bool is_private = false;
|
| // Determine if we have any tabs that should get launcher items.
|
| std::vector<TabContentsWrapper*> app_tabs;
|
| for (int i = 0; i < tab_model_->count(); ++i) {
|
| TabContentsWrapper* tab = tab_model_->GetTabContentsAt(i);
|
| if (!launcher_delegate_->GetAppID(tab).empty())
|
| app_tabs.push_back(tab);
|
| + else if (tab->profile()->GetOriginalProfile() != tab->profile())
|
| + is_private = true;
|
| }
|
|
|
| if (static_cast<int>(app_tabs.size()) != tab_model_->count())
|
| - CreateTabbedItem();
|
| + CreateTabbedItem(is_private);
|
|
|
| // Create items for the app tabs.
|
| for (size_t i = 0; i < app_tabs.size(); ++i)
|
| @@ -227,6 +230,7 @@ void LauncherUpdater::UpdateLauncher(TabContentsWrapper* tab) {
|
|
|
| void LauncherUpdater::UpdateAppTabState(TabContentsWrapper* tab,
|
| UpdateType update_type) {
|
| + bool is_incognito = (tab->profile()->GetOriginalProfile() != tab->profile());
|
| bool showing_app_item = app_map_.find(tab) != app_map_.end();
|
| std::string app_id = update_type == UPDATE_TAB_REMOVED ?
|
| std::string() : launcher_delegate_->GetAppID(tab);
|
| @@ -235,7 +239,7 @@ void LauncherUpdater::UpdateAppTabState(TabContentsWrapper* tab,
|
| if (!show_app) {
|
| if (item_id_ == -1 && update_type == UPDATE_TAB_INSERTED) {
|
| // A new non-app tab was added and we have no app tabs. Add one now.
|
| - CreateTabbedItem();
|
| + CreateTabbedItem(is_incognito);
|
| } else if (item_id_ != -1 && update_type == UPDATE_TAB_REMOVED &&
|
| tab_model_->count() == (static_cast<int>(app_map_.size()))) {
|
| launcher_delegate_->LauncherItemClosed(item_id_);
|
| @@ -270,9 +274,11 @@ void LauncherUpdater::UpdateAppTabState(TabContentsWrapper* tab,
|
| // If the app is pinned we have to leave it and create a new tabbed
|
| // item.
|
| launcher_delegate_->LauncherItemClosed(launcher_id);
|
| - CreateTabbedItem();
|
| + CreateTabbedItem(is_incognito);
|
| }
|
| - 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 {
|
| @@ -321,9 +327,12 @@ void LauncherUpdater::RegisterAppItem(ash::LauncherID id,
|
| app_map_[tab] = details;
|
| }
|
|
|
| -void LauncherUpdater::CreateTabbedItem() {
|
| +void LauncherUpdater::CreateTabbedItem(bool is_private) {
|
| DCHECK_EQ(-1, item_id_);
|
| - item_id_ = launcher_delegate_->CreateTabbedLauncherItem(this);
|
| + item_id_ = launcher_delegate_->CreateTabbedLauncherItem(
|
| + this,
|
| + is_private ? ChromeLauncherDelegate::STATE_INCOGNITO :
|
| + ChromeLauncherDelegate::STATE_NOT_INCOGNITO);
|
| }
|
|
|
| bool LauncherUpdater::ContainsID(ash::LauncherID id, TabContentsWrapper** tab) {
|
|
|