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

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

Issue 2523053004: Enhance chrome.app.window API for shelf integration with restore support (Closed)
Patch Set: 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Return true if any windows are visible. 76 // Return true if any windows are visible.
77 for (const auto* window : windows_) { 77 for (const auto* window : windows_) {
78 if (window->GetNativeWindow()->IsVisible()) 78 if (window->GetNativeWindow()->IsVisible())
79 return true; 79 return true;
80 } 80 }
81 return false; 81 return false;
82 } 82 }
83 83
84 void AppWindowLauncherItemController::Launch(ash::LaunchSource source, 84 void AppWindowLauncherItemController::Launch(ash::LaunchSource source,
85 int event_flags) { 85 int event_flags) {
86 launcher_controller()->LaunchApp(app_id(), source, ui::EF_NONE); 86 launcher_controller()->LaunchApp(app_id(), launch_id(), source, ui::EF_NONE);
87 } 87 }
88 88
89 ash::ShelfItemDelegate::PerformedAction 89 ash::ShelfItemDelegate::PerformedAction
90 AppWindowLauncherItemController::Activate(ash::LaunchSource source) { 90 AppWindowLauncherItemController::Activate(ash::LaunchSource source) {
91 DCHECK(!windows_.empty()); 91 DCHECK(!windows_.empty());
92 ui::BaseWindow* window_to_activate = 92 ui::BaseWindow* window_to_activate =
93 last_active_window_ ? last_active_window_ : windows_.back(); 93 last_active_window_ ? last_active_window_ : windows_.back();
94 window_to_activate->Activate(); 94 window_to_activate->Activate();
95 return kExistingWindowActivated; 95 return kExistingWindowActivated;
96 } 96 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (window_to_show->IsActive()) { 194 if (window_to_show->IsActive()) {
195 // Coming here, only a single window is active. For keyboard activations 195 // Coming here, only a single window is active. For keyboard activations
196 // the window gets animated. 196 // the window gets animated.
197 AnimateWindow(window_to_show->GetNativeWindow(), 197 AnimateWindow(window_to_show->GetNativeWindow(),
198 wm::WINDOW_ANIMATION_TYPE_BOUNCE); 198 wm::WINDOW_ANIMATION_TYPE_BOUNCE);
199 } else { 199 } else {
200 return ShowAndActivateOrMinimize(window_to_show); 200 return ShowAndActivateOrMinimize(window_to_show);
201 } 201 }
202 return kNoAction; 202 return kNoAction;
203 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698