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

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

Issue 2558963002: Move shelf item tooltip flag from delegate to item. (Closed)
Patch Set: Remove WmWindowMus::SetBoolProperty override. Created 4 years 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 bool AppWindowLauncherItemController::IsDraggable() { 139 bool AppWindowLauncherItemController::IsDraggable() {
140 return true; 140 return true;
141 } 141 }
142 142
143 bool AppWindowLauncherItemController::CanPin() const { 143 bool AppWindowLauncherItemController::CanPin() const {
144 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == 144 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) ==
145 AppListControllerDelegate::PIN_EDITABLE; 145 AppListControllerDelegate::PIN_EDITABLE;
146 } 146 }
147 147
148 bool AppWindowLauncherItemController::ShouldShowTooltip() {
149 return true;
150 }
151
152 void AppWindowLauncherItemController::OnWindowPropertyChanged( 148 void AppWindowLauncherItemController::OnWindowPropertyChanged(
153 aura::Window* window, 149 aura::Window* window,
154 const void* key, 150 const void* key,
155 intptr_t old) { 151 intptr_t old) {
156 if (key == aura::client::kDrawAttentionKey) { 152 if (key == aura::client::kDrawAttentionKey) {
157 ash::ShelfItemStatus status; 153 ash::ShelfItemStatus status;
158 if (ash::wm::IsActiveWindow(window)) { 154 if (ash::wm::IsActiveWindow(window)) {
159 status = ash::STATUS_ACTIVE; 155 status = ash::STATUS_ACTIVE;
160 } else if (window->GetProperty(aura::client::kDrawAttentionKey)) { 156 } else if (window->GetProperty(aura::client::kDrawAttentionKey)) {
161 status = ash::STATUS_ATTENTION; 157 status = ash::STATUS_ATTENTION;
(...skipping 26 matching lines...) Expand all
188 if (window_to_show->IsActive()) { 184 if (window_to_show->IsActive()) {
189 // Coming here, only a single window is active. For keyboard activations 185 // Coming here, only a single window is active. For keyboard activations
190 // the window gets animated. 186 // the window gets animated.
191 AnimateWindow(window_to_show->GetNativeWindow(), 187 AnimateWindow(window_to_show->GetNativeWindow(),
192 wm::WINDOW_ANIMATION_TYPE_BOUNCE); 188 wm::WINDOW_ANIMATION_TYPE_BOUNCE);
193 } else { 189 } else {
194 return ShowAndActivateOrMinimize(window_to_show); 190 return ShowAndActivateOrMinimize(window_to_show);
195 } 191 }
196 return kNoAction; 192 return kNoAction;
197 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698