| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // AppListService overrides: | 64 // AppListService overrides: |
| 65 virtual void Init(Profile* initial_profile) OVERRIDE; | 65 virtual void Init(Profile* initial_profile) OVERRIDE; |
| 66 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; | 66 virtual void CreateForProfile(Profile* requested_profile) OVERRIDE; |
| 67 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; | 67 virtual void ShowForProfile(Profile* requested_profile) OVERRIDE; |
| 68 virtual void DismissAppList() OVERRIDE; | 68 virtual void DismissAppList() OVERRIDE; |
| 69 virtual bool IsAppListVisible() const OVERRIDE; | 69 virtual bool IsAppListVisible() const OVERRIDE; |
| 70 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; | 70 virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; |
| 71 | 71 |
| 72 // AppListServiceImpl overrides: | 72 // AppListServiceImpl overrides: |
| 73 virtual void CreateShortcut() OVERRIDE; | 73 virtual void CreateShortcut() OVERRIDE; |
| 74 virtual void OnSigninStatusChanged() OVERRIDE; | |
| 75 | 74 |
| 76 // AppShimHandler overrides: | 75 // AppShimHandler overrides: |
| 77 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, | 76 virtual void OnShimLaunch(apps::AppShimHandler::Host* host, |
| 78 apps::AppShimLaunchType launch_type) OVERRIDE; | 77 apps::AppShimLaunchType launch_type) OVERRIDE; |
| 79 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; | 78 virtual void OnShimClose(apps::AppShimHandler::Host* host) OVERRIDE; |
| 80 virtual void OnShimFocus(apps::AppShimHandler::Host* host, | 79 virtual void OnShimFocus(apps::AppShimHandler::Host* host, |
| 81 apps::AppShimFocusType focus_type) OVERRIDE; | 80 apps::AppShimFocusType focus_type) OVERRIDE; |
| 82 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, | 81 virtual void OnShimSetHidden(apps::AppShimHandler::Host* host, |
| 83 bool hidden) OVERRIDE; | 82 bool hidden) OVERRIDE; |
| 84 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; | 83 virtual void OnShimQuit(apps::AppShimHandler::Host* host) OVERRIDE; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 361 |
| 363 void AppListServiceMac::CreateShortcut() { | 362 void AppListServiceMac::CreateShortcut() { |
| 364 CreateAppListShim(GetProfilePath( | 363 CreateAppListShim(GetProfilePath( |
| 365 g_browser_process->profile_manager()->user_data_dir())); | 364 g_browser_process->profile_manager()->user_data_dir())); |
| 366 } | 365 } |
| 367 | 366 |
| 368 NSWindow* AppListServiceMac::GetAppListWindow() { | 367 NSWindow* AppListServiceMac::GetAppListWindow() { |
| 369 return [window_controller_ window]; | 368 return [window_controller_ window]; |
| 370 } | 369 } |
| 371 | 370 |
| 372 void AppListServiceMac::OnSigninStatusChanged() { | |
| 373 [[window_controller_ appListViewController] onSigninStatusChanged]; | |
| 374 } | |
| 375 | |
| 376 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, | 371 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, |
| 377 apps::AppShimLaunchType launch_type) { | 372 apps::AppShimLaunchType launch_type) { |
| 378 Show(); | 373 Show(); |
| 379 observers_.AddObserver(host); | 374 observers_.AddObserver(host); |
| 380 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); | 375 host->OnAppLaunchComplete(apps::APP_SHIM_LAUNCH_SUCCESS); |
| 381 } | 376 } |
| 382 | 377 |
| 383 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { | 378 void AppListServiceMac::OnShimClose(apps::AppShimHandler::Host* host) { |
| 384 observers_.RemoveObserver(host); | 379 observers_.RemoveObserver(host); |
| 385 DismissAppList(); | 380 DismissAppList(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 506 |
| 512 // static | 507 // static |
| 513 AppListService* AppListService::Get() { | 508 AppListService* AppListService::Get() { |
| 514 return AppListServiceMac::GetInstance(); | 509 return AppListServiceMac::GetInstance(); |
| 515 } | 510 } |
| 516 | 511 |
| 517 // static | 512 // static |
| 518 void AppListService::InitAll(Profile* initial_profile) { | 513 void AppListService::InitAll(Profile* initial_profile) { |
| 519 Get()->Init(initial_profile); | 514 Get()->Init(initial_profile); |
| 520 } | 515 } |
| OLD | NEW |