Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc

Issue 2090133003: Moved methods that don't rely on internal state out of ChromeLauncherController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit changes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
11 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 12 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
12 #include "ui/aura/client/aura_constants.h" 13 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
14 #include "ui/base/base_window.h" 15 #include "ui/base/base_window.h"
15 #include "ui/wm/core/window_animations.h" 16 #include "ui/wm/core/window_animations.h"
16 17
17 AppWindowLauncherItemController::AppWindowLauncherItemController( 18 AppWindowLauncherItemController::AppWindowLauncherItemController(
18 Type type, 19 Type type,
19 const std::string& app_shelf_id, 20 const std::string& app_shelf_id,
20 const std::string& app_id, 21 const std::string& app_id,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return LauncherControllerHelper::GetAppTitle( 142 return LauncherControllerHelper::GetAppTitle(
142 launcher_controller()->GetProfile(), app_id()); 143 launcher_controller()->GetProfile(), app_id());
143 } 144 }
144 145
145 bool AppWindowLauncherItemController::IsDraggable() { 146 bool AppWindowLauncherItemController::IsDraggable() {
146 DCHECK_EQ(TYPE_APP, type()); 147 DCHECK_EQ(TYPE_APP, type());
147 return true; 148 return true;
148 } 149 }
149 150
150 bool AppWindowLauncherItemController::CanPin() const { 151 bool AppWindowLauncherItemController::CanPin() const {
151 return launcher_controller()->GetPinnable(app_id()) == 152 return GetPinnableForAppID(app_id(), launcher_controller()->GetProfile()) ==
152 AppListControllerDelegate::PIN_EDITABLE; 153 AppListControllerDelegate::PIN_EDITABLE;
153 } 154 }
154 155
155 bool AppWindowLauncherItemController::ShouldShowTooltip() { 156 bool AppWindowLauncherItemController::ShouldShowTooltip() {
156 DCHECK_EQ(TYPE_APP, type()); 157 DCHECK_EQ(TYPE_APP, type());
157 return true; 158 return true;
158 } 159 }
159 160
160 void AppWindowLauncherItemController::OnWindowPropertyChanged( 161 void AppWindowLauncherItemController::OnWindowPropertyChanged(
161 aura::Window* window, 162 aura::Window* window,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (window_to_show->IsActive()) { 197 if (window_to_show->IsActive()) {
197 // Coming here, only a single window is active. For keyboard activations 198 // Coming here, only a single window is active. For keyboard activations
198 // the window gets animated. 199 // the window gets animated.
199 AnimateWindow(window_to_show->GetNativeWindow(), 200 AnimateWindow(window_to_show->GetNativeWindow(),
200 wm::WINDOW_ANIMATION_TYPE_BOUNCE); 201 wm::WINDOW_ANIMATION_TYPE_BOUNCE);
201 } else { 202 } else {
202 return ShowAndActivateOrMinimize(window_to_show); 203 return ShowAndActivateOrMinimize(window_to_show);
203 } 204 }
204 return kNoAction; 205 return kNoAction;
205 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698