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

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 kalman@'s comment. 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d6a76d8a31337217f39dc17e0dda8b43b2808247..55e9ea0888595a8e36ad72b0b30ad16407c8d4f8 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"
@@ -177,6 +179,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(
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698