summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/browser_notification_observers.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 18:58:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 18:58:16 +0000
commitbea0616a1c86509eb3e8a05b43735d48e4cb2f6f (patch)
tree24122f23f48dd1309bc31ae066498b7a5de28c6b /chrome/browser/chromeos/browser_notification_observers.h
parent8aff4ad0475f0b3b7f16a4d02c73f1062e322d73 (diff)
downloadchromium_src-bea0616a1c86509eb3e8a05b43735d48e4cb2f6f.zip
chromium_src-bea0616a1c86509eb3e8a05b43735d48e4cb2f6f.tar.gz
chromium_src-bea0616a1c86509eb3e8a05b43735d48e4cb2f6f.tar.bz2
Add a notification observer for the first tab load for Chrome OS.
It simply records the uptime into the tmp directory for metrics collection BUG=none TEST=none Original review: http://codereview.chromium.org/548044 Patch by sosa@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36876 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/browser_notification_observers.h')
-rw-r--r--chrome/browser/chromeos/browser_notification_observers.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/browser_notification_observers.h b/chrome/browser/chromeos/browser_notification_observers.h
new file mode 100644
index 0000000..91c95b9
--- /dev/null
+++ b/chrome/browser/chromeos/browser_notification_observers.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_BROWSER_NOTIFICATION_OBSERVERS_H_
+#define CHROME_BROWSER_CHROMEOS_BROWSER_NOTIFICATION_OBSERVERS_H_
+
+#include "base/atomic_sequence_num.h"
+#include "base/singleton.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
+#include "chrome/common/notification_source.h"
+#include "chrome/common/notification_type.h"
+
+// Global notification observers for chrome os.
+namespace chromeos {
+
+// Notification observer to log the initial time of when the first tab
+// page is rendered for Chrome OS.
+class InitialTabNotificationObserver : public NotificationObserver {
+ public:
+ InitialTabNotificationObserver();
+ virtual ~InitialTabNotificationObserver();
+
+ static InitialTabNotificationObserver* Get() {
+ return Singleton<InitialTabNotificationObserver>::get();
+ }
+
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ NotificationRegistrar registrar_;
+ base::AtomicSequenceNumber num_tabs_;
+
+ DISALLOW_COPY_AND_ASSIGN(InitialTabNotificationObserver);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_BROWSER_NOTIFICATION_OBSERVERS_H_