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 #include "apps/app_shim/app_shim_handler_mac.h" | 5 #include "apps/app_shim/app_shim_handler_mac.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void ShowWindowNearDock(); | 54 void ShowWindowNearDock(); |
55 | 55 |
56 // AppListService overrides: | 56 // AppListService overrides: |
57 virtual void Init(Profile* initial_profile) OVERRIDE; | 57 virtual void Init(Profile* initial_profile) OVERRIDE; |
58 virtual void ShowAppList(Profile* requested_profile) OVERRIDE; | 58 virtual void ShowAppList(Profile* requested_profile) OVERRIDE; |
59 virtual void DismissAppList() OVERRIDE; | 59 virtual void DismissAppList() OVERRIDE; |
60 virtual bool IsAppListVisible() const OVERRIDE; | 60 virtual bool IsAppListVisible() const OVERRIDE; |
61 virtual void EnableAppList() OVERRIDE; | 61 virtual void EnableAppList() OVERRIDE; |
62 | 62 |
63 // AppShimHandler overrides: | 63 // AppShimHandler overrides: |
64 virtual bool OnShimLaunch(apps::AppShimHandler::Host* host) OVERRIDE; | 64 virtual bool OnShimLaunch(apps::AppShimHandler::Host* host, |
| 65 apps::AppShimLaunchType launch_type) OVERRIDE; |
65 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; | 66 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; |
66 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE; | 67 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE; |
67 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; | 68 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; |
68 | 69 |
69 private: | 70 private: |
70 friend struct DefaultSingletonTraits<AppListServiceMac>; | 71 friend struct DefaultSingletonTraits<AppListServiceMac>; |
71 | 72 |
72 AppListServiceMac() {} | 73 AppListServiceMac() {} |
73 | 74 |
74 scoped_nsobject<AppListWindowController> window_controller_; | 75 scoped_nsobject<AppListWindowController> window_controller_; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 265 } |
265 | 266 |
266 void AppListServiceMac::EnableAppList() { | 267 void AppListServiceMac::EnableAppList() { |
267 // TODO(tapted): Implement enable logic here for OSX. | 268 // TODO(tapted): Implement enable logic here for OSX. |
268 } | 269 } |
269 | 270 |
270 NSWindow* AppListServiceMac::GetNativeWindow() { | 271 NSWindow* AppListServiceMac::GetNativeWindow() { |
271 return [window_controller_ window]; | 272 return [window_controller_ window]; |
272 } | 273 } |
273 | 274 |
274 bool AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host) { | 275 bool AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, |
| 276 apps::AppShimLaunchType launch_type) { |
275 ShowForSavedProfile(); | 277 ShowForSavedProfile(); |
276 observers_.AddObserver(host); | 278 observers_.AddObserver(host); |
277 return true; | 279 return true; |
278 } | 280 } |
279 | 281 |
280 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { | 282 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { |
281 observers_.RemoveObserver(host); | 283 observers_.RemoveObserver(host); |
282 DismissAppList(); | 284 DismissAppList(); |
283 } | 285 } |
284 | 286 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 371 |
370 // static | 372 // static |
371 AppListService* AppListService::Get() { | 373 AppListService* AppListService::Get() { |
372 return AppListServiceMac::GetInstance(); | 374 return AppListServiceMac::GetInstance(); |
373 } | 375 } |
374 | 376 |
375 // static | 377 // static |
376 void AppListService::InitAll(Profile* initial_profile) { | 378 void AppListService::InitAll(Profile* initial_profile) { |
377 Get()->Init(initial_profile); | 379 Get()->Init(initial_profile); |
378 } | 380 } |
OLD | NEW |