OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/app_window_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" | 8 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |
9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
10 #include "ui/wm/public/activation_client.h" | 10 #include "ui/wm/public/activation_client.h" |
11 | 11 |
12 AppWindowLauncherController::AppWindowLauncherController( | 12 AppWindowLauncherController::AppWindowLauncherController( |
13 ChromeLauncherControllerImpl* owner) | 13 ChromeLauncherController* owner) |
14 : owner_(owner) { | 14 : owner_(owner) { |
15 if (ash::Shell::HasInstance()) { | 15 if (ash::Shell::HasInstance()) { |
16 if (ash::Shell::Get()->GetPrimaryRootWindow()) { | 16 if (ash::Shell::Get()->GetPrimaryRootWindow()) { |
17 activation_client_ = aura::client::GetActivationClient( | 17 activation_client_ = aura::client::GetActivationClient( |
18 ash::Shell::Get()->GetPrimaryRootWindow()); | 18 ash::Shell::Get()->GetPrimaryRootWindow()); |
19 if (activation_client_) | 19 if (activation_client_) |
20 activation_client_->AddObserver(this); | 20 activation_client_->AddObserver(this); |
21 } | 21 } |
22 } | 22 } |
23 } | 23 } |
(...skipping 14 matching lines...) Expand all Loading... |
38 new_controller->SetActiveWindow(new_active); | 38 new_controller->SetActiveWindow(new_active); |
39 owner_->SetItemStatus(new_controller->shelf_id(), ash::STATUS_ACTIVE); | 39 owner_->SetItemStatus(new_controller->shelf_id(), ash::STATUS_ACTIVE); |
40 } | 40 } |
41 | 41 |
42 // Mark the old active window's launcher item as running (if different). | 42 // Mark the old active window's launcher item as running (if different). |
43 AppWindowLauncherItemController* old_controller = | 43 AppWindowLauncherItemController* old_controller = |
44 ControllerForWindow(old_active); | 44 ControllerForWindow(old_active); |
45 if (old_controller && old_controller != new_controller) | 45 if (old_controller && old_controller != new_controller) |
46 owner_->SetItemStatus(old_controller->shelf_id(), ash::STATUS_RUNNING); | 46 owner_->SetItemStatus(old_controller->shelf_id(), ash::STATUS_RUNNING); |
47 } | 47 } |
OLD | NEW |