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

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

Issue 2819413003: Refactor extension app icon. (Closed)
Patch Set: rename ExtensionAppIcon -> ChromeAppIcon Created 3 years, 7 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 "ash/public/interfaces/constants.mojom.h" 7 #include "ash/public/interfaces/constants.mojom.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/chromeos/arc/arc_util.h"
10 #include "chrome/browser/extensions/extension_app_icon_loader.h" 10 #include "chrome/browser/extensions/chrome_app_icon_loader.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #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"
13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" 13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
15 #include "content/public/common/service_manager_connection.h" 15 #include "content/public/common/service_manager_connection.h"
16 #include "services/service_manager/public/cpp/connector.h" 16 #include "services/service_manager/public/cpp/connector.h"
17 #include "ui/display/display.h" 17 #include "ui/display/display.h"
18 #include "ui/display/screen.h" 18 #include "ui/display/screen.h"
19 19
20 // static 20 // static
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 base::MakeUnique<LauncherControllerHelper>(profile_); 134 base::MakeUnique<LauncherControllerHelper>(profile_);
135 } else { 135 } else {
136 launcher_controller_helper_->set_profile(profile_); 136 launcher_controller_helper_->set_profile(profile_);
137 } 137 }
138 138
139 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded 139 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded
140 // image is associated with a profile (its loader requires the profile). 140 // image is associated with a profile (its loader requires the profile).
141 // Since icon size changes are possible, the icon could be requested to be 141 // Since icon size changes are possible, the icon could be requested to be
142 // reloaded. However - having it not multi profile aware would cause problems 142 // reloaded. However - having it not multi profile aware would cause problems
143 // if the icon cache gets deleted upon user switch. 143 // if the icon cache gets deleted upon user switch.
144 std::unique_ptr<AppIconLoader> extension_app_icon_loader = 144 std::unique_ptr<AppIconLoader> chrome_app_icon_loader =
145 base::MakeUnique<extensions::ExtensionAppIconLoader>( 145 base::MakeUnique<extensions::ChromeAppIconLoader>(
146 profile_, extension_misc::EXTENSION_ICON_SMALL, this); 146 profile_, extension_misc::EXTENSION_ICON_SMALL, this);
147 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); 147 app_icon_loaders_.push_back(std::move(chrome_app_icon_loader));
148 148
149 if (arc::IsArcAllowedForProfile(profile_)) { 149 if (arc::IsArcAllowedForProfile(profile_)) {
150 std::unique_ptr<AppIconLoader> arc_app_icon_loader = 150 std::unique_ptr<AppIconLoader> arc_app_icon_loader =
151 base::MakeUnique<ArcAppIconLoader>( 151 base::MakeUnique<ArcAppIconLoader>(
152 profile_, extension_misc::EXTENSION_ICON_SMALL, this); 152 profile_, extension_misc::EXTENSION_ICON_SMALL, this);
153 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); 153 app_icon_loaders_.push_back(std::move(arc_app_icon_loader));
154 } 154 }
155 155
156 SetShelfBehaviorsFromPrefs(); 156 SetShelfBehaviorsFromPrefs();
157 } 157 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // This will uselessly store a preference value for invalid display ids. 189 // This will uselessly store a preference value for invalid display ids.
190 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, 190 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id,
191 auto_hide); 191 auto_hide);
192 } 192 }
193 193
194 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, 194 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id,
195 const gfx::ImageSkia& image) { 195 const gfx::ImageSkia& image) {
196 // Implemented by subclasses; this should not be called. 196 // Implemented by subclasses; this should not be called.
197 NOTREACHED(); 197 NOTREACHED();
198 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698