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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/extensions/extension_app_icon_loader.h" 8 #include "chrome/browser/extensions/extension_app_icon_loader.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" 10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h"
11 #include "chrome/browser/ui/ash/ash_util.h" 11 #include "chrome/browser/ui/ash/ash_util.h"
12 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 12 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
13 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 13 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
14 #include "content/public/common/service_manager_connection.h" 14 #include "content/public/common/service_manager_connection.h"
15 #include "services/service_manager/public/cpp/connector.h" 15 #include "services/service_manager/public/cpp/connector.h"
16 #include "ui/display/display.h" 16 #include "ui/display/display.h"
17 #include "ui/display/screen.h" 17 #include "ui/display/screen.h"
18 18
19 // static 19 // static
20 ChromeLauncherController* ChromeLauncherController::instance_ = nullptr; 20 ChromeLauncherController* ChromeLauncherController::instance_ = nullptr;
21 21
22 ChromeLauncherController::~ChromeLauncherController() { 22 ChromeLauncherController::~ChromeLauncherController() {
23 if (instance_ == this) 23 if (instance_ == this)
24 instance_ = nullptr; 24 instance_ = nullptr;
25 } 25 }
26 26
27 void ChromeLauncherController::LaunchApp(const std::string& app_id, 27 void ChromeLauncherController::LaunchApp(const std::string& app_id,
28 const std::string& launch_id,
28 ash::LaunchSource source, 29 ash::LaunchSource source,
29 int event_flags) { 30 int event_flags) {
30 launcher_controller_helper_->LaunchApp(app_id, source, event_flags); 31 launcher_controller_helper_->LaunchApp(app_id, launch_id, source,
32 event_flags);
31 } 33 }
32 34
33 ChromeLauncherController::ChromeLauncherController() : observer_binding_(this) { 35 ChromeLauncherController::ChromeLauncherController() : observer_binding_(this) {
34 DCHECK(!instance_); 36 DCHECK(!instance_);
35 instance_ = this; 37 instance_ = this;
36 // Start observing the shelf controller immediately. 38 // Start observing the shelf controller immediately.
37 if (ConnectToShelfController()) { 39 if (ConnectToShelfController()) {
38 ash::mojom::ShelfObserverAssociatedPtrInfo ptr_info; 40 ash::mojom::ShelfObserverAssociatedPtrInfo ptr_info;
39 observer_binding_.Bind(&ptr_info, shelf_controller_.associated_group()); 41 observer_binding_.Bind(&ptr_info, shelf_controller_.associated_group());
40 shelf_controller_->AddObserver(std::move(ptr_info)); 42 shelf_controller_->AddObserver(std::move(ptr_info));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // TODO(msw): Avoid handling this pref change and forwarding the value to ash. 180 // TODO(msw): Avoid handling this pref change and forwarding the value to ash.
179 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, 181 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id,
180 auto_hide); 182 auto_hide);
181 } 183 }
182 184
183 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, 185 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id,
184 const gfx::ImageSkia& image) { 186 const gfx::ImageSkia& image) {
185 // Implemented by subclasses; this should not be called. 187 // Implemented by subclasses; this should not be called.
186 NOTREACHED(); 188 NOTREACHED();
187 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698