Index: chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc |
diff --git a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc |
index f227d2c3a5eda3ebca3c9dca77c7c2d05661854b..3563c3cc5769c40d60407d202c47b6d932ee29c2 100644 |
--- a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc |
+++ b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.cc |
@@ -20,6 +20,7 @@ |
#include "chrome/browser/web_applications/web_app.h" |
#include "content/public/browser/web_contents.h" |
#include "grit/ui_resources.h" |
+#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/window.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -37,10 +38,12 @@ BrowserLauncherItemController::BrowserLauncherItemController( |
is_incognito_(tab_model->profile()->GetOriginalProfile() != |
tab_model->profile() && !Profile::IsGuestSession()), |
item_id_(-1) { |
+ window_->AddObserver(this); |
sky
2012/05/18 22:29:42
We're going to want to support this for windows ot
|
} |
BrowserLauncherItemController::~BrowserLauncherItemController() { |
tab_model_->RemoveObserver(this); |
+ window_->RemoveObserver(this); |
if (item_id_ != -1) |
launcher_controller_->LauncherItemClosed(item_id_); |
} |
@@ -95,10 +98,7 @@ BrowserLauncherItemController* BrowserLauncherItemController::Create( |
} |
void BrowserLauncherItemController::BrowserActivationStateChanged() { |
- launcher_controller_->SetItemStatus( |
- item_id_, |
- ash::wm::IsActiveWindow(window_) ? |
- ash::STATUS_ACTIVE : ash::STATUS_RUNNING); |
+ UpdateItemStatus(); |
} |
void BrowserLauncherItemController::ActiveTabChanged( |
@@ -138,6 +138,29 @@ void BrowserLauncherItemController::FaviconUpdated() { |
UpdateLauncher(tab_model_->GetActiveTabContents()); |
} |
+void BrowserLauncherItemController::OnWindowPropertyChanged( |
+ aura::Window* window, |
+ const void* key, |
+ intptr_t old) { |
+ if (key == aura::client::kDrawAttentionKey) |
+ UpdateItemStatus(); |
+} |
+ |
+void BrowserLauncherItemController::UpdateItemStatus() { |
+ ash::LauncherItemStatus status; |
+ if (ash::wm::IsActiveWindow(window_)) { |
+ // Clear attention state if active. |
+ if (window_->GetProperty(aura::client::kDrawAttentionKey)) |
+ window_->SetProperty(aura::client::kDrawAttentionKey, false); |
+ status = ash::STATUS_ACTIVE; |
+ } else if (window_->GetProperty(aura::client::kDrawAttentionKey)) { |
+ status = ash::STATUS_ATTENTION; |
+ } else { |
+ status = ash::STATUS_RUNNING; |
+ } |
+ launcher_controller_->SetItemStatus(item_id_, status); |
+} |
+ |
void BrowserLauncherItemController::UpdateLauncher(TabContentsWrapper* tab) { |
if (type_ == TYPE_APP_PANEL) |
return; // Maintained entirely by ChromeLauncherController. |