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

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

Issue 1921403002: Pin apps from prefs on the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only include arc for cros. Created 4 years, 7 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"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // item if the window we are trying to activate is already active. 130 // item if the window we are trying to activate is already active.
131 if (windows_.size() >= 1 && window_to_show->IsActive() && 131 if (windows_.size() >= 1 && window_to_show->IsActive() &&
132 event.type() == ui::ET_KEY_RELEASED) { 132 event.type() == ui::ET_KEY_RELEASED) {
133 return ActivateOrAdvanceToNextAppWindow(window_to_show); 133 return ActivateOrAdvanceToNextAppWindow(window_to_show);
134 } else { 134 } else {
135 return ShowAndActivateOrMinimize(window_to_show); 135 return ShowAndActivateOrMinimize(window_to_show);
136 } 136 }
137 } 137 }
138 138
139 base::string16 AppWindowLauncherItemController::GetTitle() { 139 base::string16 AppWindowLauncherItemController::GetTitle() {
140 return GetAppTitle(); 140 return GetAppTitle(launcher_controller()->profile(), app_id());
141 } 141 }
142 142
143 bool AppWindowLauncherItemController::IsDraggable() { 143 bool AppWindowLauncherItemController::IsDraggable() {
144 DCHECK_EQ(TYPE_APP, type()); 144 DCHECK_EQ(TYPE_APP, type());
145 return CanPin(); 145 return CanPin();
146 } 146 }
147 147
148 bool AppWindowLauncherItemController::CanPin() const { 148 bool AppWindowLauncherItemController::CanPin() const {
149 return launcher_controller()->CanPin(app_id()); 149 return launcher_controller()->CanPin(app_id());
150 } 150 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (window_to_show->IsActive()) { 193 if (window_to_show->IsActive()) {
194 // Coming here, only a single window is active. For keyboard activations 194 // Coming here, only a single window is active. For keyboard activations
195 // the window gets animated. 195 // the window gets animated.
196 AnimateWindow(window_to_show->GetNativeWindow(), 196 AnimateWindow(window_to_show->GetNativeWindow(),
197 wm::WINDOW_ANIMATION_TYPE_BOUNCE); 197 wm::WINDOW_ANIMATION_TYPE_BOUNCE);
198 } else { 198 } else {
199 return ShowAndActivateOrMinimize(window_to_show); 199 return ShowAndActivateOrMinimize(window_to_show);
200 } 200 }
201 return kNoAction; 201 return kNoAction;
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698