| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // AppLauncherItemController for each |app_launcher_id_|. | 176 // AppLauncherItemController for each |app_launcher_id_|. |
| 177 const std::string app_launcher_id_; | 177 const std::string app_launcher_id_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(AppLauncherItemController); | 179 DISALLOW_COPY_AND_ASSIGN(AppLauncherItemController); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 // ShellWindowLauncherController ----------------------------------------------- | 182 // ShellWindowLauncherController ----------------------------------------------- |
| 183 | 183 |
| 184 ShellWindowLauncherController::ShellWindowLauncherController( | 184 ShellWindowLauncherController::ShellWindowLauncherController( |
| 185 ChromeLauncherController* owner) | 185 ChromeLauncherController* owner) |
| 186 : owner_(owner), | 186 : ActivationChangeShim(ash::Shell::HasInstance() ? |
| 187 ash::Shell::GetInstance() : NULL), |
| 188 owner_(owner), |
| 187 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), | 189 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), |
| 188 activation_client_(NULL) { | 190 activation_client_(NULL) { |
| 189 registry_->AddObserver(this); | 191 registry_->AddObserver(this); |
| 190 if (ash::Shell::HasInstance()) { | 192 if (ash::Shell::HasInstance()) { |
| 191 if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) { | 193 if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) { |
| 192 activation_client_ = aura::client::GetActivationClient( | 194 activation_client_ = aura::client::GetActivationClient( |
| 193 ash::Shell::GetInstance()->GetPrimaryRootWindow()); | 195 ash::Shell::GetInstance()->GetPrimaryRootWindow()); |
| 194 if (activation_client_) | 196 if (activation_client_) |
| 195 activation_client_->AddObserver(this); | 197 activation_client_->AddObserver(this); |
| 196 } | 198 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 WindowToAppLauncherIdMap::iterator iter1 = | 307 WindowToAppLauncherIdMap::iterator iter1 = |
| 306 window_to_app_launcher_id_map_.find(window); | 308 window_to_app_launcher_id_map_.find(window); |
| 307 if (iter1 == window_to_app_launcher_id_map_.end()) | 309 if (iter1 == window_to_app_launcher_id_map_.end()) |
| 308 return NULL; | 310 return NULL; |
| 309 std::string app_launcher_id = iter1->second; | 311 std::string app_launcher_id = iter1->second; |
| 310 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 312 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
| 311 if (iter2 == app_controller_map_.end()) | 313 if (iter2 == app_controller_map_.end()) |
| 312 return NULL; | 314 return NULL; |
| 313 return iter2->second; | 315 return iter2->second; |
| 314 } | 316 } |
| OLD | NEW |