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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_api.cc

Issue 1004263002: Disable surprise me automatically if the current wallpaper was set by a third party application. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Biao's comments. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/wallpaper_api.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc
index 5eb9af3dcf20b53a175461c4b38e680228cbfa2e..2c03c3847535bc647a0381303deb2858c5cf3185 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc
@@ -14,6 +14,7 @@
#include "base/strings/stringprintf.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/extensions/wallpaper_private_api.h"
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
@@ -22,6 +23,7 @@
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "components/wallpaper/wallpaper_layout.h"
+#include "extensions/browser/event_router.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
@@ -175,6 +177,18 @@ void WallpaperSetWallpaperFunction::OnWallpaperDecoded(
}
SendResponse(true);
}
+
+ // Inform the native Wallpaper Picker Application that the current wallpaper
+ // has been modified by a third party application.
+ Profile* profile = Profile::FromBrowserContext(browser_context());
+ extensions::EventRouter* event_router = extensions::EventRouter::Get(profile);
+ scoped_ptr<base::ListValue> event_args(new base::ListValue());
+ scoped_ptr<extensions::Event> event(
+ new extensions::Event(extensions::api::wallpaper_private::
+ OnWallpaperChangedBy3rdParty::kEventName,
+ event_args.Pass()));
+ event_router->DispatchEventToExtension(extension_misc::kWallpaperManagerId,
+ event.Pass());
}
void WallpaperSetWallpaperFunction::GenerateThumbnail(

Powered by Google App Engine
This is Rietveld 408576698