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

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

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: address comments Created 3 years, 10 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 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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/chromeos/arc/arc_util.h"
9 #include "chrome/browser/extensions/extension_app_icon_loader.h" 10 #include "chrome/browser/extensions/extension_app_icon_loader.h"
10 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" 12 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h"
12 #include "chrome/browser/ui/ash/ash_util.h" 13 #include "chrome/browser/ui/ash/ash_util.h"
13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 14 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
15 #include "content/public/common/service_manager_connection.h" 16 #include "content/public/common/service_manager_connection.h"
16 #include "services/service_manager/public/cpp/connector.h" 17 #include "services/service_manager/public/cpp/connector.h"
17 #include "ui/display/display.h" 18 #include "ui/display/display.h"
18 #include "ui/display/screen.h" 19 #include "ui/display/screen.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded 141 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded
141 // image is associated with a profile (its loader requires the profile). 142 // image is associated with a profile (its loader requires the profile).
142 // Since icon size changes are possible, the icon could be requested to be 143 // Since icon size changes are possible, the icon could be requested to be
143 // reloaded. However - having it not multi profile aware would cause problems 144 // reloaded. However - having it not multi profile aware would cause problems
144 // if the icon cache gets deleted upon user switch. 145 // if the icon cache gets deleted upon user switch.
145 std::unique_ptr<AppIconLoader> extension_app_icon_loader = 146 std::unique_ptr<AppIconLoader> extension_app_icon_loader =
146 base::MakeUnique<extensions::ExtensionAppIconLoader>( 147 base::MakeUnique<extensions::ExtensionAppIconLoader>(
147 profile_, extension_misc::EXTENSION_ICON_SMALL, this); 148 profile_, extension_misc::EXTENSION_ICON_SMALL, this);
148 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); 149 app_icon_loaders_.push_back(std::move(extension_app_icon_loader));
149 150
150 if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) { 151 if (arc::IsArcAllowedForProfile(profile_)) {
151 std::unique_ptr<AppIconLoader> arc_app_icon_loader = 152 std::unique_ptr<AppIconLoader> arc_app_icon_loader =
152 base::MakeUnique<ArcAppIconLoader>( 153 base::MakeUnique<ArcAppIconLoader>(
153 profile_, extension_misc::EXTENSION_ICON_SMALL, this); 154 profile_, extension_misc::EXTENSION_ICON_SMALL, this);
154 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); 155 app_icon_loaders_.push_back(std::move(arc_app_icon_loader));
155 } 156 }
156 157
157 SetShelfBehaviorsFromPrefs(); 158 SetShelfBehaviorsFromPrefs();
158 } 159 }
159 160
160 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { 161 void ChromeLauncherController::OnShelfCreated(int64_t display_id) {
(...skipping 29 matching lines...) Expand all
190 // This will uselessly store a preference value for invalid display ids. 191 // This will uselessly store a preference value for invalid display ids.
191 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, 192 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id,
192 auto_hide); 193 auto_hide);
193 } 194 }
194 195
195 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, 196 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id,
196 const gfx::ImageSkia& image) { 197 const gfx::ImageSkia& image) {
197 // Implemented by subclasses; this should not be called. 198 // Implemented by subclasses; this should not be called.
198 NOTREACHED(); 199 NOTREACHED();
199 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698