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

Unified Diff: chrome/browser/ui/website_settings/permission_bubble_manager.cc

Issue 1154943008: Update push messaging tests to use both infobars and bubbles (w/ autoresponse) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factor out the GetPermissionBubbleManager calls Created 5 years, 7 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/ui/website_settings/permission_bubble_manager.cc
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.cc b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
index b8a53e5f08765fb3e7b7617707defa9c23b538b6..4b64088c87d693c0575da3f8df0684475d33ef4a 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.cc
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
@@ -57,6 +57,15 @@ class CancelledRequest : public PermissionBubbleRequest {
DEFINE_WEB_CONTENTS_USER_DATA_KEY(PermissionBubbleManager);
+// PermissionBubbleManager::Observer -------------------------------------------
+PermissionBubbleManager::Observer::~Observer() {
+}
+
+void PermissionBubbleManager::Observer::OnBubbleAdded() {
+}
+
+// PermissionBubbleManager -----------------------------------------------------
+
// static
bool PermissionBubbleManager::Enabled() {
// Command line flags take precedence.
@@ -346,6 +355,7 @@ void PermissionBubbleManager::TriggerShowBubble() {
// case we may do in-line calling of finalization.
bubble_showing_ = true;
view_->Show(requests_, accept_states_);
+ NotifyBubbleAdded(view_);
msw 2015/06/04 01:22:08 Instead of adding the observer and responder class
felt 2015/06/05 00:38:21 There is one disadvantage of the set_auto_response
}
void PermissionBubbleManager::FinalizeBubble() {
@@ -414,3 +424,14 @@ bool PermissionBubbleManager::HasUserGestureRequest(
return false;
}
+void PermissionBubbleManager::AddObserver(Observer* obs) {
+ observer_list_.AddObserver(obs);
+}
+
+void PermissionBubbleManager::RemoveObserver(Observer* obs) {
+ observer_list_.RemoveObserver(obs);
+}
+
+void PermissionBubbleManager::NotifyBubbleAdded(PermissionBubbleView* bubble) {
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnBubbleAdded());
+}

Powered by Google App Engine
This is Rietveld 408576698