Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_ | |
| 7 | |
| 8 #include "chrome/browser/ui/browser_list.h" | |
| 9 #include "chrome/browser/ui/browser_list_observer.h" | |
| 10 | |
| 11 namespace chromeos { | |
| 12 namespace first_run { | |
| 13 | |
| 14 // Handles display of OOBE Goodies page on first display of browser window on | |
| 15 // new Chromebooks. | |
| 16 class GoodiesDisplayer : public chrome::BrowserListObserver { | |
| 17 public: | |
| 18 // Used to create, host, and destroy GoodiesDisplayer. | |
| 19 class Delegate { | |
| 20 public: | |
| 21 Delegate(); | |
| 22 virtual ~Delegate(); | |
| 23 | |
| 24 // Create singleton object if it doesn't already exist. | |
| 25 void CreateGoodiesDisplayer(); | |
|
achuithb
2015/09/18 19:05:52
Don't think you need this method
| |
| 26 | |
| 27 // Destroy singleton object. | |
| 28 void DestroyGoodiesDisplayer(); | |
|
achuithb
2015/09/18 19:05:52
You don't need this method
| |
| 29 | |
| 30 // Get age of device; overridable for testing. | |
| 31 virtual base::TimeDelta GetTimeSinceOobe(); | |
| 32 | |
| 33 private: | |
| 34 // Holds singleton GoodiesDisplayer object. | |
| 35 scoped_ptr<GoodiesDisplayer> goodies_displayer_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(Delegate); | |
| 38 }; | |
| 39 | |
| 40 explicit GoodiesDisplayer(Delegate* delegate); | |
| 41 ~GoodiesDisplayer() override; | |
| 42 | |
| 43 static void Init(Delegate* delegate); | |
| 44 | |
| 45 private: | |
| 46 // Overridden from chrome::BrowserListObserver. | |
| 47 void OnBrowserSetLastActive(Browser* browser) override; | |
| 48 | |
| 49 Delegate* delegate_; // Pointer to owner. | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(GoodiesDisplayer); | |
| 52 }; | |
| 53 | |
| 54 } // namespace first_run | |
| 55 } // namespace chromeos | |
| 56 | |
| 57 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_ | |
| OLD | NEW |