OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_MAC_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "apps/app_shim/app_shim_handler_mac.h" |
| 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 13 |
| 14 @class AppListAnimationController; |
| 15 @class AppListWindowController; |
| 16 template <typename T> struct DefaultSingletonTraits; |
| 17 |
| 18 namespace test { |
| 19 class AppListServiceTestApiMac; |
| 20 } |
| 21 |
| 22 // AppListServiceMac manages global resources needed for the app list to |
| 23 // operate, and controls when the app list is opened and closed. |
| 24 class AppListServiceMac : public AppListServiceImpl, |
| 25 public apps::AppShimHandler { |
| 26 public: |
| 27 virtual ~AppListServiceMac(); |
| 28 |
| 29 static AppListServiceMac* GetInstance(); |
| 30 |
| 31 void ShowWindowNearDock(); |
| 32 |
| 33 // AppListService overrides: |
| 34 virtual void Init(Profile* initial_profile) OVERRIDE; |
| 35 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; |
| 36 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; |
| 37 virtual void DismissAppList() OVERRIDE; |
| 38 virtual bool IsAppListVisible() const OVERRIDE; |
| 39 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; |
| 40 virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE; |
| 41 |
| 42 // AppListServiceImpl overrides: |
| 43 virtual void CreateShortcut() OVERRIDE; |
| 44 |
| 45 // AppShimHandler overrides: |
| 46 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, |
| 47 apps::AppShimLaunchType launch_type) OVERRIDE; |
| 48 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; |
| 49 virtual void OnShimFocus(apps::AppShimHandler::Host* host, |
| 50 apps::AppShimFocusType focus_type) OVERRIDE; |
| 51 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, |
| 52 bool hidden) OVERRIDE; |
| 53 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; |
| 54 |
| 55 private: |
| 56 friend struct DefaultSingletonTraits<AppListServiceMac>; |
| 57 friend class test::AppListServiceTestApiMac; |
| 58 |
| 59 AppListServiceMac(); |
| 60 |
| 61 base::scoped_nsobject<AppListWindowController> window_controller_; |
| 62 base::scoped_nsobject<AppListAnimationController> animation_controller_; |
| 63 base::scoped_nsobject<NSRunningApplication> previously_active_application_; |
| 64 NSPoint last_start_origin_; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(AppListServiceMac); |
| 67 }; |
| 68 |
| 69 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_MAC_H_ |
OLD | NEW |