| 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_item_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // item if the window we are trying to activate is already active. | 133 // item if the window we are trying to activate is already active. |
| 134 if (windows_.size() >= 1 && window_to_show->IsActive() && | 134 if (windows_.size() >= 1 && window_to_show->IsActive() && |
| 135 event.type() == ui::ET_KEY_RELEASED) { | 135 event.type() == ui::ET_KEY_RELEASED) { |
| 136 return ActivateOrAdvanceToNextAppWindow(window_to_show); | 136 return ActivateOrAdvanceToNextAppWindow(window_to_show); |
| 137 } else { | 137 } else { |
| 138 return ShowAndActivateOrMinimize(window_to_show); | 138 return ShowAndActivateOrMinimize(window_to_show); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 base::string16 AppWindowLauncherItemController::GetTitle() { | 142 base::string16 AppWindowLauncherItemController::GetTitle() { |
| 143 return LauncherControllerHelper::GetAppTitle( | 143 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), |
| 144 launcher_controller()->GetProfile(), app_id()); | 144 app_id()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool AppWindowLauncherItemController::IsDraggable() { | 147 bool AppWindowLauncherItemController::IsDraggable() { |
| 148 DCHECK_EQ(TYPE_APP, type()); | 148 DCHECK_EQ(TYPE_APP, type()); |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool AppWindowLauncherItemController::CanPin() const { | 152 bool AppWindowLauncherItemController::CanPin() const { |
| 153 return GetPinnableForAppID(app_id(), launcher_controller()->GetProfile()) == | 153 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == |
| 154 AppListControllerDelegate::PIN_EDITABLE; | 154 AppListControllerDelegate::PIN_EDITABLE; |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool AppWindowLauncherItemController::ShouldShowTooltip() { | 157 bool AppWindowLauncherItemController::ShouldShowTooltip() { |
| 158 DCHECK_EQ(TYPE_APP, type()); | 158 DCHECK_EQ(TYPE_APP, type()); |
| 159 return true; | 159 return true; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void AppWindowLauncherItemController::OnWindowPropertyChanged( | 162 void AppWindowLauncherItemController::OnWindowPropertyChanged( |
| 163 aura::Window* window, | 163 aura::Window* window, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (window_to_show->IsActive()) { | 198 if (window_to_show->IsActive()) { |
| 199 // Coming here, only a single window is active. For keyboard activations | 199 // Coming here, only a single window is active. For keyboard activations |
| 200 // the window gets animated. | 200 // the window gets animated. |
| 201 AnimateWindow(window_to_show->GetNativeWindow(), | 201 AnimateWindow(window_to_show->GetNativeWindow(), |
| 202 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 202 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 203 } else { | 203 } else { |
| 204 return ShowAndActivateOrMinimize(window_to_show); | 204 return ShowAndActivateOrMinimize(window_to_show); |
| 205 } | 205 } |
| 206 return kNoAction; | 206 return kNoAction; |
| 207 } | 207 } |
| OLD | NEW |