| 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_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/app_list/app_list_service_views.h" | 10 #include "chrome/browser/ui/app_list/app_list_service_views.h" |
| 11 | 11 |
| 12 class ActivationTrackerWin; | 12 class ActivationTrackerWin; |
| 13 | 13 |
| 14 namespace base { |
| 14 template <typename T> struct DefaultSingletonTraits; | 15 template <typename T> struct DefaultSingletonTraits; |
| 16 } |
| 15 | 17 |
| 16 class AppListServiceWin : public AppListServiceViews { | 18 class AppListServiceWin : public AppListServiceViews { |
| 17 public: | 19 public: |
| 18 ~AppListServiceWin() override; | 20 ~AppListServiceWin() override; |
| 19 | 21 |
| 20 static AppListServiceWin* GetInstance(); | 22 static AppListServiceWin* GetInstance(); |
| 21 | 23 |
| 22 // AppListService overrides: | 24 // AppListService overrides: |
| 23 void SetAppListNextPaintCallback(void (*callback)()) override; | 25 void SetAppListNextPaintCallback(void (*callback)()) override; |
| 24 void Init(Profile* initial_profile) override; | 26 void Init(Profile* initial_profile) override; |
| 25 void ShowForProfile(Profile* requested_profile) override; | 27 void ShowForProfile(Profile* requested_profile) override; |
| 26 void CreateShortcut() override; | 28 void CreateShortcut() override; |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 friend struct DefaultSingletonTraits<AppListServiceWin>; | 31 friend struct base::DefaultSingletonTraits<AppListServiceWin>; |
| 30 | 32 |
| 31 // AppListServiceViews overrides: | 33 // AppListServiceViews overrides: |
| 32 void OnViewBeingDestroyed() override; | 34 void OnViewBeingDestroyed() override; |
| 33 | 35 |
| 34 // AppListShowerDelegate overrides: | 36 // AppListShowerDelegate overrides: |
| 35 void OnViewCreated() override; | 37 void OnViewCreated() override; |
| 36 void OnViewDismissed() override; | 38 void OnViewDismissed() override; |
| 37 void MoveNearCursor(app_list::AppListView* view) override; | 39 void MoveNearCursor(app_list::AppListView* view) override; |
| 38 | 40 |
| 39 AppListServiceWin(); | 41 AppListServiceWin(); |
| 40 | 42 |
| 41 bool IsWarmupNeeded(); | 43 bool IsWarmupNeeded(); |
| 42 void ScheduleWarmup(); | 44 void ScheduleWarmup(); |
| 43 | 45 |
| 44 // Loads the profile last used with the app list and populates the view from | 46 // Loads the profile last used with the app list and populates the view from |
| 45 // it without showing it so that the next show is faster. Does nothing if the | 47 // it without showing it so that the next show is faster. Does nothing if the |
| 46 // view already exists, or another profile is in the middle of being loaded to | 48 // view already exists, or another profile is in the middle of being loaded to |
| 47 // be shown. | 49 // be shown. |
| 48 void LoadProfileForWarmup(); | 50 void LoadProfileForWarmup(); |
| 49 void OnLoadProfileForWarmup(Profile* initial_profile); | 51 void OnLoadProfileForWarmup(Profile* initial_profile); |
| 50 | 52 |
| 51 scoped_ptr<ActivationTrackerWin> activation_tracker_; | 53 scoped_ptr<ActivationTrackerWin> activation_tracker_; |
| 52 | 54 |
| 53 base::Closure next_paint_callback_; | 55 base::Closure next_paint_callback_; |
| 54 | 56 |
| 55 DISALLOW_COPY_AND_ASSIGN(AppListServiceWin); | 57 DISALLOW_COPY_AND_ASSIGN(AppListServiceWin); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_APP_LIST_SERVICE_WIN_H_ |
| OLD | NEW |