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

Unified Diff: chrome/browser/chromeos/first_run/goodies_displayer.h

Issue 1308833004: Show Goodies page to new Chromebook users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change delegate from interface to implementation Created 5 years, 3 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/chromeos/first_run/goodies_displayer.h
diff --git a/chrome/browser/chromeos/first_run/goodies_displayer.h b/chrome/browser/chromeos/first_run/goodies_displayer.h
new file mode 100644
index 0000000000000000000000000000000000000000..97d0ed6b33968c772a79bc9573aad73b9dccc9c2
--- /dev/null
+++ b/chrome/browser/chromeos/first_run/goodies_displayer.h
@@ -0,0 +1,57 @@
+// Copyright 2015 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_FIRST_RUN_GOODIES_DISPLAYER_H_
+#define CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_
+
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_list_observer.h"
+
+namespace chromeos {
+namespace first_run {
+
+// Handles display of OOBE Goodies page on first display of browser window on
+// new Chromebooks.
+class GoodiesDisplayer : public chrome::BrowserListObserver {
+ public:
+ // Used to create, host, and destroy GoodiesDisplayer.
+ class Delegate {
+ public:
+ Delegate();
+ virtual ~Delegate();
+
+ // Create singleton object if it doesn't already exist.
+ void CreateGoodiesDisplayer();
achuithb 2015/09/18 19:05:52 Don't think you need this method
+
+ // Destroy singleton object.
+ void DestroyGoodiesDisplayer();
achuithb 2015/09/18 19:05:52 You don't need this method
+
+ // Get age of device; overridable for testing.
+ virtual base::TimeDelta GetTimeSinceOobe();
+
+ private:
+ // Holds singleton GoodiesDisplayer object.
+ scoped_ptr<GoodiesDisplayer> goodies_displayer_;
+
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
+ explicit GoodiesDisplayer(Delegate* delegate);
+ ~GoodiesDisplayer() override;
+
+ static void Init(Delegate* delegate);
+
+ private:
+ // Overridden from chrome::BrowserListObserver.
+ void OnBrowserSetLastActive(Browser* browser) override;
+
+ Delegate* delegate_; // Pointer to owner.
+
+ DISALLOW_COPY_AND_ASSIGN(GoodiesDisplayer);
+};
+
+} // namespace first_run
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_

Powered by Google App Engine
This is Rietveld 408576698