Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 14579005: Close all windows when app shim quits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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 }
OLDNEW
« chrome/browser/resources/ntp4/apps_page.js ('K') | « chrome/browser/resources/ntp4/apps_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698