| 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 <ApplicationServices/ApplicationServices.h> | 5 #include <ApplicationServices/ApplicationServices.h> |
| 6 #import <Cocoa/Cocoa.h> | 6 #import <Cocoa/Cocoa.h> |
| 7 | 7 |
| 8 #include "apps/app_launcher.h" | 8 #include "apps/app_launcher.h" |
| 9 #include "apps/app_shim/app_shim_handler_mac.h" | 9 #include "apps/app_shim/app_shim_handler_mac.h" |
| 10 #include "apps/app_shim/app_shim_mac.h" | 10 #include "apps/app_shim/app_shim_mac.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // AppListService overrides: | 68 // AppListService overrides: |
| 69 virtual void Init(Profile* initial_profile) OVERRIDE; | 69 virtual void Init(Profile* initial_profile) OVERRIDE; |
| 70 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; | 70 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; |
| 71 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; | 71 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; |
| 72 virtual void DismissAppList() OVERRIDE; | 72 virtual void DismissAppList() OVERRIDE; |
| 73 virtual bool IsAppListVisible() const OVERRIDE; | 73 virtual bool IsAppListVisible() const OVERRIDE; |
| 74 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; | 74 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; |
| 75 | 75 |
| 76 // AppListServiceImpl overrides: | 76 // AppListServiceImpl overrides: |
| 77 virtual void CreateShortcut() OVERRIDE; | 77 virtual void CreateShortcut() OVERRIDE; |
| 78 virtual void OnSigninStatusChanged() OVERRIDE; | |
| 79 | 78 |
| 80 // AppShimHandler overrides: | 79 // AppShimHandler overrides: |
| 81 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, | 80 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, |
| 82 apps::AppShimLaunchType launch_type) OVERRIDE; | 81 apps::AppShimLaunchType launch_type) OVERRIDE; |
| 83 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; | 82 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; |
| 84 virtual void OnShimFocus(apps::AppShimHandler::Host* host, | 83 virtual void OnShimFocus(apps::AppShimHandler::Host* host, |
| 85 apps::AppShimFocusType focus_type) OVERRIDE; | 84 apps::AppShimFocusType focus_type) OVERRIDE; |
| 86 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, | 85 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, |
| 87 bool hidden) OVERRIDE; | 86 bool hidden) OVERRIDE; |
| 88 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; | 87 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 388 |
| 390 void AppListServiceMac::CreateShortcut() { | 389 void AppListServiceMac::CreateShortcut() { |
| 391 CreateAppListShim(GetProfilePath( | 390 CreateAppListShim(GetProfilePath( |
| 392 g_browser_process->profile_manager()->user_data_dir())); | 391 g_browser_process->profile_manager()->user_data_dir())); |
| 393 } | 392 } |
| 394 | 393 |
| 395 NSWindow* AppListServiceMac::GetAppListWindow() { | 394 NSWindow* AppListServiceMac::GetAppListWindow() { |
| 396 return [window_controller_ window]; | 395 return [window_controller_ window]; |
| 397 } | 396 } |
| 398 | 397 |
| 399 void AppListServiceMac::OnSigninStatusChanged() { | |
| 400 [[window_controller_ appListViewController] onSigninStatusChanged]; | |
| 401 } | |
| 402 | |
| 403 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, | 398 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, |
| 404 apps::AppShimLaunchType launch_type) { | 399 apps::AppShimLaunchType launch_type) { |
| 405 Show(); | 400 Show(); |
| 406 observers_.AddObserver(host); | 401 observers_.AddObserver(host); |
| 407 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); | 402 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); |
| 408 } | 403 } |
| 409 | 404 |
| 410 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { | 405 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { |
| 411 observers_.RemoveObserver(host); | 406 observers_.RemoveObserver(host); |
| 412 DismissAppList(); | 407 DismissAppList(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 533 |
| 539 // static | 534 // static |
| 540 AppListService* AppListService::Get() { | 535 AppListService* AppListService::Get() { |
| 541 return AppListServiceMac::GetInstance(); | 536 return AppListServiceMac::GetInstance(); |
| 542 } | 537 } |
| 543 | 538 |
| 544 // static | 539 // static |
| 545 void AppListService::InitAll(Profile* initial_profile) { | 540 void AppListService::InitAll(Profile* initial_profile) { |
| 546 Get()->Init(initial_profile); | 541 Get()->Init(initial_profile); |
| 547 } | 542 } |
| OLD | NEW |