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

Unified Diff: chrome/browser/extensions/extension_message_bubble_controller.h

Issue 1455313002: [Reland][Extensions] Don't count bubble focus loss as acknowledgment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 1 month 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/extension_message_bubble_controller.h
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.h b/chrome/browser/extensions/extension_message_bubble_controller.h
index 40e5b81bead2fba0d851d0c343d549b96ea3a94c..c3059c53efdcc9985387dd47ed2fc30de6e26d90 100644
--- a/chrome/browser/extensions/extension_message_bubble_controller.h
+++ b/chrome/browser/extensions/extension_message_bubble_controller.h
@@ -24,8 +24,9 @@ class ExtensionMessageBubbleController {
enum BubbleAction {
ACTION_LEARN_MORE = 0,
ACTION_EXECUTE,
- ACTION_DISMISS,
- ACTION_BOUNDARY, // Must be the last value.
+ ACTION_DISMISS_USER_ACTION,
+ ACTION_DISMISS_DEACTIVATION,
+ ACTION_BOUNDARY, // Must be the last value.
};
class Delegate {
@@ -74,14 +75,22 @@ class ExtensionMessageBubbleController {
virtual void LogExtensionCount(size_t count) = 0;
virtual void LogAction(BubbleAction action) = 0;
- // Has the user acknowledged info about the extension the bubble reports.
- virtual bool HasBubbleInfoBeenAcknowledged(const std::string& extension_id);
- virtual void SetBubbleInfoBeenAcknowledged(const std::string& extension_id,
- bool value);
+ // Returns a key unique to the type of bubble that can be used to retrieve
+ // state specific to the type (e.g., shown for profiles).
+ virtual const char* GetKey() = 0;
+
+ // Whether the "shown for profiles" set should be cleared if an action is
+ // taken on the bubble. This defaults to true, since once an action is
+ // taken, the extension will usually either be acknowledged or removed, and
+ // the bubble won't show for that extension.
+ // This should be false in cases where there is no acknowledgment option
+ // (as in the developer-mode extension warning).
+ virtual bool ClearProfileSetAfterAction();
- // Returns the set of profiles for which this bubble has been shown.
- // If profiles are not tracked, returns null (default).
- virtual std::set<Profile*>* GetProfileSet();
+ // Has the user acknowledged info about the extension the bubble reports.
+ bool HasBubbleInfoBeenAcknowledged(const std::string& extension_id);
+ void SetBubbleInfoBeenAcknowledged(const std::string& extension_id,
+ bool value);
protected:
Profile* profile() { return profile_; }
@@ -141,9 +150,11 @@ class ExtensionMessageBubbleController {
// Callbacks from bubble. Declared virtual for testing purposes.
virtual void OnBubbleAction();
- virtual void OnBubbleDismiss();
+ virtual void OnBubbleDismiss(bool dismissed_by_deactivation);
virtual void OnLinkClicked();
+ void ClearProfileListForTesting();
+
static void set_should_ignore_learn_more_for_testing(
bool should_ignore_learn_more);
@@ -157,6 +168,8 @@ class ExtensionMessageBubbleController {
// Performs cleanup after the bubble closes.
void OnClose();
+ std::set<Profile*>* GetProfileSet();
+
// A weak pointer to the Browser we are associated with. Not owned by us.
Browser* browser_;

Powered by Google App Engine
This is Rietveld 408576698