| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Gets the instance for the given profile. | 32 // Gets the instance for the given profile. |
| 33 static StartPageService* Get(Profile* profile); | 33 static StartPageService* Get(Profile* profile); |
| 34 | 34 |
| 35 content::WebContents* contents() { return contents_.get(); } | 35 content::WebContents* contents() { return contents_.get(); } |
| 36 RecommendedApps* recommended_apps() { return recommended_apps_.get(); } | 36 RecommendedApps* recommended_apps() { return recommended_apps_.get(); } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // A BrowserContextKeyedServiceFactory for this service. | 39 // A BrowserContextKeyedServiceFactory for this service. |
| 40 class Factory; | 40 class Factory; |
| 41 | 41 |
| 42 // ExitObserver to shutdown the service on exiting. WebContents depends | 42 // ProfileDestroyObserver to shutdown the service on exiting. WebContents |
| 43 // on the profile and needs to be closed before the profile and its | 43 // depends on the profile and needs to be closed before the profile and its |
| 44 // keyed service shutdown. | 44 // keyed service shutdown. |
| 45 class ExitObserver; | 45 class ProfileDestroyObserver; |
| 46 | 46 |
| 47 explicit StartPageService(Profile* profile); | 47 explicit StartPageService(Profile* profile); |
| 48 virtual ~StartPageService(); | 48 virtual ~StartPageService(); |
| 49 | 49 |
| 50 // BrowserContextKeyedService overrides: | 50 // BrowserContextKeyedService overrides: |
| 51 virtual void Shutdown() OVERRIDE; | 51 virtual void Shutdown() OVERRIDE; |
| 52 | 52 |
| 53 Profile* profile_; | 53 Profile* profile_; |
| 54 scoped_ptr<content::WebContents> contents_; | 54 scoped_ptr<content::WebContents> contents_; |
| 55 scoped_ptr<ExitObserver> exit_observer_; | 55 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; |
| 56 scoped_ptr<RecommendedApps> recommended_apps_; | 56 scoped_ptr<RecommendedApps> recommended_apps_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(StartPageService); | 58 DISALLOW_COPY_AND_ASSIGN(StartPageService); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace app_list | 61 } // namespace app_list |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ | 63 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ |
| OLD | NEW |