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

Unified Diff: components/arc/intent_helper/arc_intent_helper_bridge.cc

Issue 2264743002: cheets: implement cros side of WallpaperManagerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a static instance to SetWallpaperDelegate and null check to ArcIntentHelper. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/intent_helper/arc_intent_helper_bridge.cc
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc
index 64176dde1c09fb92f4d975f9b5d73ef6f534b039..3d7e2ec521ccb6226c9ad35e4cb8f241c10e646e 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -31,12 +31,10 @@ constexpr char kArcIntentHelperPackageName[] = "org.chromium.arc.intent_helper";
ArcIntentHelperBridge::ArcIntentHelperBridge(
ArcBridgeService* bridge_service,
const scoped_refptr<ActivityIconLoader>& icon_loader,
- std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate,
const scoped_refptr<LocalActivityResolver>& activity_resolver)
: ArcService(bridge_service),
binding_(this),
icon_loader_(icon_loader),
- set_wallpaper_delegate_(std::move(set_wallpaper_delegate)),
activity_resolver_(activity_resolver) {
DCHECK(thread_checker_.CalledOnValidThread());
arc_bridge_service()->intent_helper()->AddObserver(this);
@@ -87,7 +85,12 @@ void ArcIntentHelperBridge::OpenWallpaperPicker() {
void ArcIntentHelperBridge::SetWallpaper(mojo::Array<uint8_t> jpeg_data) {
DCHECK(thread_checker_.CalledOnValidThread());
- set_wallpaper_delegate_->SetWallpaper(jpeg_data.PassStorage());
+ SetWallpaperDelegate* delegate = SetWallpaperDelegate::GetInstance();
+ if (delegate == nullptr) {
+ LOG(ERROR) << "SetWallpaperDelegate is not available.";
+ return;
+ }
+ delegate->SetWallpaperJPEG(jpeg_data.PassStorage());
}
std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel(

Powered by Google App Engine
This is Rietveld 408576698