| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // AppLauncherItemController for each |app_launcher_id_|. | 177 // AppLauncherItemController for each |app_launcher_id_|. |
| 178 const std::string app_launcher_id_; | 178 const std::string app_launcher_id_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(AppLauncherItemController); | 180 DISALLOW_COPY_AND_ASSIGN(AppLauncherItemController); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 // ShellWindowLauncherController ----------------------------------------------- | 183 // ShellWindowLauncherController ----------------------------------------------- |
| 184 | 184 |
| 185 ShellWindowLauncherController::ShellWindowLauncherController( | 185 ShellWindowLauncherController::ShellWindowLauncherController( |
| 186 ChromeLauncherController* owner) | 186 ChromeLauncherController* owner) |
| 187 : owner_(owner), | 187 : ActivationChangeShim(ash::Shell::HasInstance() ? |
| 188 ash::Shell::GetInstance() : NULL), |
| 189 owner_(owner), |
| 188 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), | 190 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), |
| 189 activation_client_(NULL) { | 191 activation_client_(NULL) { |
| 190 registry_->AddObserver(this); | 192 registry_->AddObserver(this); |
| 191 if (ash::Shell::HasInstance()) { | 193 if (ash::Shell::HasInstance()) { |
| 192 if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) { | 194 if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) { |
| 193 activation_client_ = aura::client::GetActivationClient( | 195 activation_client_ = aura::client::GetActivationClient( |
| 194 ash::Shell::GetInstance()->GetPrimaryRootWindow()); | 196 ash::Shell::GetInstance()->GetPrimaryRootWindow()); |
| 195 if (activation_client_) | 197 if (activation_client_) |
| 196 activation_client_->AddObserver(this); | 198 activation_client_->AddObserver(this); |
| 197 } | 199 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 WindowToAppLauncherIdMap::iterator iter1 = | 308 WindowToAppLauncherIdMap::iterator iter1 = |
| 307 window_to_app_launcher_id_map_.find(window); | 309 window_to_app_launcher_id_map_.find(window); |
| 308 if (iter1 == window_to_app_launcher_id_map_.end()) | 310 if (iter1 == window_to_app_launcher_id_map_.end()) |
| 309 return NULL; | 311 return NULL; |
| 310 std::string app_launcher_id = iter1->second; | 312 std::string app_launcher_id = iter1->second; |
| 311 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 313 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
| 312 if (iter2 == app_controller_map_.end()) | 314 if (iter2 == app_controller_map_.end()) |
| 313 return NULL; | 315 return NULL; |
| 314 return iter2->second; | 316 return iter2->second; |
| 315 } | 317 } |
| OLD | NEW |