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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) OVERRIDE; |
65 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; | 65 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; |
66 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE; | 66 virtual void OnShimFocus(apps::AppShimHandler::Host* host) OVERRIDE; |
| 67 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; |
67 | 68 |
68 private: | 69 private: |
69 friend struct DefaultSingletonTraits<AppListServiceMac>; | 70 friend struct DefaultSingletonTraits<AppListServiceMac>; |
70 | 71 |
71 AppListServiceMac() {} | 72 AppListServiceMac() {} |
72 | 73 |
73 scoped_nsobject<AppListWindowController> window_controller_; | 74 scoped_nsobject<AppListWindowController> window_controller_; |
74 | 75 |
75 // App shim hosts observing when the app list is dismissed. In normal user | 76 // App shim hosts observing when the app list is dismissed. In normal user |
76 // usage there should only be one. However, it can't be guaranteed, so use | 77 // usage there should only be one. However, it can't be guaranteed, so use |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 280 |
280 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { | 281 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { |
281 observers_.RemoveObserver(host); | 282 observers_.RemoveObserver(host); |
282 DismissAppList(); | 283 DismissAppList(); |
283 } | 284 } |
284 | 285 |
285 void AppListServiceMac::OnShimFocus(apps::AppShimHandler::Host* host) { | 286 void AppListServiceMac::OnShimFocus(apps::AppShimHandler::Host* host) { |
286 DismissAppList(); | 287 DismissAppList(); |
287 } | 288 } |
288 | 289 |
| 290 void AppListServiceMac::OnShimQuit(apps::AppShimHandler::Host* host) { |
| 291 DismissAppList(); |
| 292 } |
| 293 |
289 enum DockLocation { | 294 enum DockLocation { |
290 DockLocationOtherDisplay, | 295 DockLocationOtherDisplay, |
291 DockLocationBottom, | 296 DockLocationBottom, |
292 DockLocationLeft, | 297 DockLocationLeft, |
293 DockLocationRight, | 298 DockLocationRight, |
294 }; | 299 }; |
295 | 300 |
296 DockLocation DockLocationInDisplay(const gfx::Display& display) { | 301 DockLocation DockLocationInDisplay(const gfx::Display& display) { |
297 // Assume the dock occupies part of the work area either on the left, right or | 302 // Assume the dock occupies part of the work area either on the left, right or |
298 // bottom of the display. Note in the autohide case, it is always 4 pixels. | 303 // bottom of the display. Note in the autohide case, it is always 4 pixels. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 370 |
366 // static | 371 // static |
367 AppListService* AppListService::Get() { | 372 AppListService* AppListService::Get() { |
368 return AppListServiceMac::GetInstance(); | 373 return AppListServiceMac::GetInstance(); |
369 } | 374 } |
370 | 375 |
371 // static | 376 // static |
372 void AppListService::InitAll(Profile* initial_profile) { | 377 void AppListService::InitAll(Profile* initial_profile) { |
373 Get()->Init(initial_profile); | 378 Get()->Init(initial_profile); |
374 } | 379 } |
OLD | NEW |