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 // 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.
| |
| 19 class Delegate { | |
| 20 public: | |
| 21 Delegate(); | |
| 22 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
| |
| 23 | |
| 24 // Create singleton object if it doesn't already exist. | |
| 25 void CreateGoodiesDisplayer(); | |
| 26 | |
| 27 // Destroy singleton object. | |
| 28 void DestroyGoodiesDisplayer(); | |
| 29 | |
| 30 // Get age of device; overridable for testing. | |
| 31 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.
| |
| 32 | |
| 33 private: | |
| 34 // Holds singleton GoodiesDisplayer object. | |
| 35 scoped_ptr<GoodiesDisplayer> goodies_displayer_; | |
| 36 }; | |
|
achuithb
2015/09/18 16:39:11
DISALLOW_COPY_AND_ASSIGN
Greg Levin
2015/09/18 18:49:27
Done.
| |
| 37 | |
| 38 explicit GoodiesDisplayer(Delegate* delegate); | |
| 39 ~GoodiesDisplayer() override; | |
| 40 | |
| 41 static void Init(Delegate* delegate); | |
| 42 | |
| 43 private: | |
| 44 // Overridden from chrome::BrowserListObserver. | |
| 45 void OnBrowserSetLastActive(Browser* browser) override; | |
| 46 | |
| 47 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.
| |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(GoodiesDisplayer); | |
| 50 }; | |
| 51 | |
| 52 } // namespace first_run | |
| 53 } // namespace chromeos | |
| 54 | |
| 55 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_GOODIES_DISPLAYER_H_ | |
| OLD | NEW |