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

Unified Diff: chrome/browser/extensions/settings_api_bubble_controller.cc

Issue 1087713002: [Reland] [Extensions] Make extension message bubble factory platform-abstract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 8 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/extensions/settings_api_bubble_controller.cc
diff --git a/chrome/browser/extensions/settings_api_bubble_controller.cc b/chrome/browser/extensions/settings_api_bubble_controller.cc
index e89f42f129033152457ea5d93a2587c2347aeaa3..e90cf936acd09c2c5ba26e269dabe57a4f5e464b 100644
--- a/chrome/browser/extensions/settings_api_bubble_controller.cc
+++ b/chrome/browser/extensions/settings_api_bubble_controller.cc
@@ -54,6 +54,7 @@ class SettingsApiBubbleDelegate
base::string16 GetActionButtonLabel() const override;
base::string16 GetDismissButtonLabel() const override;
bool ShouldShowExtensionList() const override;
+ bool ShouldHighlightExtensions() const override;
void LogExtensionCount(size_t count) override;
void LogAction(
ExtensionMessageBubbleController::BubbleAction action) override;
@@ -244,6 +245,10 @@ bool SettingsApiBubbleDelegate::ShouldShowExtensionList() const {
return false;
}
+bool SettingsApiBubbleDelegate::ShouldHighlightExtensions() const {
+ return type_ == BUBBLE_TYPE_STARTUP_PAGES;
+}
+
void SettingsApiBubbleDelegate::LogExtensionCount(size_t count) {
}
@@ -290,11 +295,27 @@ SettingsApiBubbleController::SettingsApiBubbleController(
SettingsApiBubbleController::~SettingsApiBubbleController() {}
-bool SettingsApiBubbleController::ShouldShow(const std::string& extension_id) {
- if (delegate()->HasBubbleInfoBeenAcknowledged(extension_id))
+bool SettingsApiBubbleController::ShouldShow() {
+ const Extension* extension = nullptr;
+ switch (type_) {
+ case BUBBLE_TYPE_HOME_PAGE:
+ extension = GetExtensionOverridingHomepage(profile_);
+ break;
+ case BUBBLE_TYPE_SEARCH_ENGINE:
+ extension = GetExtensionOverridingSearchEngine(profile_);
+ break;
+ case BUBBLE_TYPE_STARTUP_PAGES:
+ extension = GetExtensionOverridingStartupPages(profile_);
+ break;
+ }
+
+ if (!extension)
+ return false;
+
+ if (delegate()->HasBubbleInfoBeenAcknowledged(extension->id()))
return false;
- if (!delegate()->ShouldIncludeExtension(extension_id))
+ if (!delegate()->ShouldIncludeExtension(extension->id()))
return false;
// If the browser is showing the 'Chrome crashed' infobar, it won't be showing

Powered by Google App Engine
This is Rietveld 408576698