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

Side by Side Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc

Issue 2718043002: Replace more hardcoded "ash" strings with ash::mojom::kServiceName (Closed)
Patch Set: Remove ash_util includes that are no longer needed. Created 3 years, 9 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 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/chromeos/login/users/wallpaper/wallpaper_manager.h" 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/wallpaper/wallpaper_controller.h" 10 #include "ash/common/wallpaper/wallpaper_controller.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ash/public/interfaces/constants.mojom.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
14 #include "base/command_line.h" 15 #include "base/command_line.h"
15 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
17 #include "base/metrics/histogram_macros.h" 18 #include "base/metrics/histogram_macros.h"
18 #include "base/path_service.h" 19 #include "base/path_service.h"
19 #include "base/sha1.h" 20 #include "base/sha1.h"
20 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
21 #include "base/sys_info.h" 22 #include "base/sys_info.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 void SetWallpaper(const gfx::ImageSkia& image, 199 void SetWallpaper(const gfx::ImageSkia& image,
199 wallpaper::WallpaperLayout layout) { 200 wallpaper::WallpaperLayout layout) {
200 if (chrome::IsRunningInMash()) { 201 if (chrome::IsRunningInMash()) {
201 // In mash, connect to the WallpaperController interface via mojo. 202 // In mash, connect to the WallpaperController interface via mojo.
202 service_manager::Connector* connector = 203 service_manager::Connector* connector =
203 content::ServiceManagerConnection::GetForProcess()->GetConnector(); 204 content::ServiceManagerConnection::GetForProcess()->GetConnector();
204 if (!connector) 205 if (!connector)
205 return; 206 return;
206 207
207 ash::mojom::WallpaperControllerPtr wallpaper_controller; 208 ash::mojom::WallpaperControllerPtr wallpaper_controller;
208 connector->BindInterface(ash_util::GetAshServiceName(), 209 connector->BindInterface(ash::mojom::kServiceName, &wallpaper_controller);
209 &wallpaper_controller);
210 // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending 210 // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending
211 // large bitmaps over Mojo; use shared memory like BitmapUploader, etc. 211 // large bitmaps over Mojo; use shared memory like BitmapUploader, etc.
212 wallpaper_controller->SetWallpaper(*image.bitmap(), layout); 212 wallpaper_controller->SetWallpaper(*image.bitmap(), layout);
213 } else if (ash::WmShell::HasInstance()) { 213 } else if (ash::WmShell::HasInstance()) {
214 // Note: Wallpaper setting is skipped in unit tests without shell instances. 214 // Note: Wallpaper setting is skipped in unit tests without shell instances.
215 // In classic ash, interact with the WallpaperController class directly. 215 // In classic ash, interact with the WallpaperController class directly.
216 ash::WmShell::Get()->wallpaper_controller()->SetWallpaperImage(image, 216 ash::WmShell::Get()->wallpaper_controller()->SetWallpaperImage(image,
217 layout); 217 layout);
218 } 218 }
219 } 219 }
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 ->GetSequencedTaskRunnerWithShutdownBehavior( 881 ->GetSequencedTaskRunnerWithShutdownBehavior(
882 sequence_token_, base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 882 sequence_token_, base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
883 883
884 user_manager::UserManager::Get()->AddSessionStateObserver(this); 884 user_manager::UserManager::Get()->AddSessionStateObserver(this);
885 885
886 content::ServiceManagerConnection* connection = 886 content::ServiceManagerConnection* connection =
887 content::ServiceManagerConnection::GetForProcess(); 887 content::ServiceManagerConnection::GetForProcess();
888 if (connection && connection->GetConnector()) { 888 if (connection && connection->GetConnector()) {
889 // Connect to the wallpaper controller interface in the ash service. 889 // Connect to the wallpaper controller interface in the ash service.
890 ash::mojom::WallpaperControllerPtr wallpaper_controller_ptr; 890 ash::mojom::WallpaperControllerPtr wallpaper_controller_ptr;
891 connection->GetConnector()->BindInterface(ash_util::GetAshServiceName(), 891 connection->GetConnector()->BindInterface(ash::mojom::kServiceName,
892 &wallpaper_controller_ptr); 892 &wallpaper_controller_ptr);
893 // Register this object as the wallpaper picker. 893 // Register this object as the wallpaper picker.
894 wallpaper_controller_ptr->SetWallpaperPicker( 894 wallpaper_controller_ptr->SetWallpaperPicker(
895 binding_.CreateInterfacePtrAndBind()); 895 binding_.CreateInterfacePtrAndBind());
896 } 896 }
897 } 897 }
898 898
899 WallpaperManager::PendingWallpaper* WallpaperManager::GetPendingWallpaper( 899 WallpaperManager::PendingWallpaper* WallpaperManager::GetPendingWallpaper(
900 const AccountId& account_id, 900 const AccountId& account_id,
901 bool delayed) { 901 bool delayed) {
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 1407
1408 UMA_HISTOGRAM_ENUMERATION( 1408 UMA_HISTOGRAM_ENUMERATION(
1409 "Ash.Wallpaper.Apps", 1409 "Ash.Wallpaper.Apps",
1410 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile) 1410 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile)
1411 ? WALLPAPERS_APP_ANDROID 1411 ? WALLPAPERS_APP_ANDROID
1412 : WALLPAPERS_PICKER_APP_CHROMEOS, 1412 : WALLPAPERS_PICKER_APP_CHROMEOS,
1413 WALLPAPERS_APPS_NUM); 1413 WALLPAPERS_APPS_NUM);
1414 } 1414 }
1415 1415
1416 } // namespace chromeos 1416 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/locale_change_guard.cc ('k') | chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698