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

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

Issue 2540433002: Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Dedupe some code + propagate flags from JS 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc_app_deferred_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
6 6
7 #include <string>
8
7 #include "chrome/browser/chromeos/arc/arc_support_host.h" 9 #include "chrome/browser/chromeos/arc/arc_support_host.h"
8 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
10 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll er.h" 12 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll er.h"
11 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 13 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
15 #include "ui/events/event_constants.h"
13 #include "ui/gfx/canvas.h" 16 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/image/canvas_image_source.h" 17 #include "ui/gfx/image/canvas_image_source.h"
15 #include "ui/gfx/image/image_skia_operations.h" 18 #include "ui/gfx/image/image_skia_operations.h"
16 #include "ui/gfx/paint_throbber.h" 19 #include "ui/gfx/paint_throbber.h"
17 20
18 namespace { 21 namespace {
19 22
20 constexpr int kUpdateIconIntervalMs = 40; // 40ms for 25 frames per second. 23 constexpr int kUpdateIconIntervalMs = 40; // 40ms for 25 frames per second.
21 constexpr int kSpinningGapPercent = 25; 24 constexpr int kSpinningGapPercent = 25;
22 25
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return; 127 return;
125 128
126 const std::string shelf_app_id = 129 const std::string shelf_app_id =
127 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); 130 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id);
128 AppControllerMap::const_iterator it = app_controller_map_.find(shelf_app_id); 131 AppControllerMap::const_iterator it = app_controller_map_.find(shelf_app_id);
129 if (it == app_controller_map_.end()) 132 if (it == app_controller_map_.end())
130 return; 133 return;
131 134
132 Close(app_id); 135 Close(app_id);
133 136
134 arc::LaunchApp(observed_profile_, app_id); 137 arc::LaunchApp(observed_profile_, app_id, ui::EF_NONE);
135 } 138 }
136 139
137 void ArcAppDeferredLauncherController::OnAppRemoved(const std::string& app_id) { 140 void ArcAppDeferredLauncherController::OnAppRemoved(const std::string& app_id) {
138 Close(app_id); 141 Close(app_id);
139 } 142 }
140 143
141 void ArcAppDeferredLauncherController::OnOptInEnabled(bool enabled) { 144 void ArcAppDeferredLauncherController::OnOptInEnabled(bool enabled) {
142 if (enabled) 145 if (enabled)
143 return; 146 return;
144 147
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } else { 214 } else {
212 owner_->SetItemController(shelf_id, controller); 215 owner_->SetItemController(shelf_id, controller);
213 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING); 216 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING);
214 } 217 }
215 218
216 if (app_controller_map_.empty()) 219 if (app_controller_map_.empty())
217 RegisterNextUpdate(); 220 RegisterNextUpdate();
218 221
219 app_controller_map_[shelf_app_id] = controller; 222 app_controller_map_[shelf_app_id] = controller;
220 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698