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

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 the code review 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..a6dfb477fa3aff9c825d57034816899649db010d 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc
@@ -22,6 +22,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"
@@ -120,6 +121,15 @@ bool WallpaperSetWallpaperFunction::RunAsync() {
SendResponse(false);
}
}
+
+ 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::OnWallpaperChangedBy3rdParty::kEventName,
+ event_args.Pass()));
+ event_router->DispatchEventToExtension(extension_misc::kWallpaperManagerId,
+ event.Pass());
bshe 2015/03/16 14:02:40 We should send the event only after we know for su
return true;
}

Powered by Google App Engine
This is Rietveld 408576698