summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider_observers.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/automation/automation_provider_observers.h')
-rw-r--r--chrome/browser/automation/automation_provider_observers.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h
index c9e3afd..78dc586 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -562,6 +562,33 @@ class TabLanguageDeterminedObserver : public NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(TabLanguageDeterminedObserver);
};
+class InfoBarCountObserver : public NotificationObserver {
+ public:
+ InfoBarCountObserver(AutomationProvider* automation,
+ IPC::Message* reply_message,
+ TabContents* tab_contents,
+ int target_count);
+
+ // NotificationObserver interface.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ // Checks whether the infobar count matches our target, and if so
+ // sends the reply message and deletes itself.
+ void CheckCount();
+
+ NotificationRegistrar registrar_;
+ AutomationProvider* automation_;
+ IPC::Message* reply_message_;
+ TabContents* tab_contents_;
+
+ const int target_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(InfoBarCountObserver);
+};
+
#if defined(OS_CHROMEOS)
// Collects LOGIN_AUTHENTICATION notifications and returns
// whether authentication succeeded to the automation provider.