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..cd7fd08c609614b977aa260092fe23c7c3742259 |
--- /dev/null |
+++ b/chrome/browser/chromeos/first_run/goodies_displayer.h |
@@ -0,0 +1,55 @@ |
+// 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: |
+ // Primarily used to create, host, and destroy singleton GoodiesDisplayer. |
achuithb
2015/09/18 16:39:11
Drop Primarily, and singleton.
Greg Levin
2015/09/18 18:49:27
Done.
|
+ class Delegate { |
+ public: |
+ Delegate(); |
+ virtual ~Delegate(); |
Greg Levin
2015/09/17 23:21:40
Is it possible to in-line these? When I tried I g
achuithb
2015/09/18 16:39:11
No, you cannot/should not since this class owns a
Greg Levin
2015/09/18 18:49:27
Acknowledged.
Didn't make dtor protected since cla
|
+ |
+ // Create singleton object if it doesn't already exist. |
+ void CreateGoodiesDisplayer(); |
+ |
+ // Destroy singleton object. |
+ void DestroyGoodiesDisplayer(); |
+ |
+ // Get age of device; overridable for testing. |
+ virtual base::TimeDelta GetTimeSinceOobe(); |
Greg Levin
2015/09/17 23:21:40
It appears to be atypical to put implementation in
achuithb
2015/09/18 16:39:11
No, you're not allowed to do this. You can only in
Greg Levin
2015/09/18 18:49:27
Acknowledged.
|
+ |
+ private: |
+ // Holds singleton GoodiesDisplayer object. |
+ scoped_ptr<GoodiesDisplayer> goodies_displayer_; |
+ }; |
achuithb
2015/09/18 16:39:11
DISALLOW_COPY_AND_ASSIGN
Greg Levin
2015/09/18 18:49:27
Done.
|
+ |
+ explicit GoodiesDisplayer(Delegate* delegate); |
+ ~GoodiesDisplayer() override; |
+ |
+ static void Init(Delegate* delegate); |
+ |
+ private: |
+ // Overridden from chrome::BrowserListObserver. |
+ void OnBrowserSetLastActive(Browser* browser) override; |
+ |
+ Delegate* delegate_; |
Greg Levin
2015/09/17 23:21:40
Is there a smart pointer type I should use here in
achuithb
2015/09/18 16:39:11
It shouldn't be a problem, but you should add a co
Greg Levin
2015/09/18 18:49:27
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(GoodiesDisplayer); |
+}; |
+ |
+} // namespace first_run |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_ |