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

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: change instance getter / setter in SetWallpaperDelegate to snake_case. 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
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.h ('k') | components/arc/set_wallpaper_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b502d0cd32dd331fb667f9895b052ed5e9beb363 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -28,15 +28,17 @@ constexpr char kArcIntentHelperPackageName[] = "org.chromium.arc.intent_helper";
} // namespace
+// TODO(muyuanli): This will be removed once SetWallpaperDelegate class is
+// removed.
+SetWallpaperDelegate* SetWallpaperDelegate::instance_ = nullptr;
+
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 +89,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::instance();
+ if (delegate == nullptr) {
+ LOG(ERROR) << "SetWallpaperDelegate is not available.";
+ return;
+ }
+ delegate->SetWallpaperJpeg(jpeg_data.PassStorage());
}
std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel(
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.h ('k') | components/arc/set_wallpaper_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698