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

Unified Diff: chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc

Issue 10855113: Show extension settings for extension notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 | « chrome/browser/ui/views/ash/balloon_collection_impl_ash.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc
diff --git a/chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc b/chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc
index 7e2428bdb04abf3407e7926d64e7ab97ed23a6a5..a8bcb457657bef0a17f98da4baeb684d46b504f6 100644
--- a/chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc
+++ b/chrome/browser/ui/views/ash/balloon_collection_impl_ash.cc
@@ -59,17 +59,10 @@ void BalloonCollectionImplAsh::Add(const Notification& notification,
void BalloonCollectionImplAsh::DisableExtension(
const std::string& notifcation_id) {
Balloon* balloon = base().FindBalloonById(notifcation_id);
- if (!balloon)
- return;
- ExtensionService* extension_service =
- balloon->profile()->GetExtensionService();
- const GURL& origin = balloon->notification().origin_url();
- const extensions::Extension* extension =
- extension_service->extensions()->GetExtensionOrAppByURL(
- ExtensionURLInfo(origin));
+ const extensions::Extension* extension = GetBalloonExtension(balloon);
if (!extension)
return;
- extension_service->DisableExtension(
+ balloon->profile()->GetExtensionService()->DisableExtension(
extension->id(), extensions::Extension::DISABLE_USER_ACTION);
}
@@ -93,7 +86,10 @@ void BalloonCollectionImplAsh::ShowSettings(const std::string& notifcation_id) {
Profile* profile =
balloon ? balloon->profile() : ProfileManager::GetDefaultProfile();
Browser* browser = browser::FindOrCreateTabbedBrowser(profile);
- chrome::ShowContentSettings(browser, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
+ if (GetBalloonExtension(balloon))
+ chrome::ShowExtensions(browser);
+ else
+ chrome::ShowContentSettings(browser, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
}
void BalloonCollectionImplAsh::OnClicked(const std::string& notifcation_id) {
@@ -168,6 +164,17 @@ Balloon* BalloonCollectionImplAsh::MakeBalloon(
return balloon;
}
+const extensions::Extension* BalloonCollectionImplAsh::GetBalloonExtension(
+ Balloon* balloon) {
+ if (!balloon)
+ return NULL;
+ ExtensionService* extension_service =
+ balloon->profile()->GetExtensionService();
+ const GURL& origin = balloon->notification().origin_url();
+ return extension_service->extensions()->GetExtensionOrAppByURL(
+ ExtensionURLInfo(origin));
+}
+
// For now, only use BalloonCollectionImplAsh on ChromeOS, until
// system_notifications_ is replaced with status area notifications.
#if defined(OS_CHROMEOS)
« no previous file with comments | « chrome/browser/ui/views/ash/balloon_collection_impl_ash.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698