| 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 #import "chrome/browser/ui/app_list/app_list_service_mac.h" | 5 #import "chrome/browser/ui/app_list/app_list_service_mac.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "apps/app_shim/app_shim_mac.h" | 10 #include "apps/app_shim/app_shim_mac.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #import "chrome/browser/app_controller_mac.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/extension_system.h" | 20 #include "chrome/browser/extensions/extension_system.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 22 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 22 #include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h" | 23 #include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h" |
| 23 #include "chrome/browser/ui/app_list/app_list_service.h" | 24 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 24 #include "chrome/browser/ui/app_list/app_list_service_impl.h" | 25 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 25 #include "chrome/browser/ui/app_list/app_list_util.h" | 26 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 26 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 27 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 bool AppListServiceMac::IsAppListVisible() const { | 404 bool AppListServiceMac::IsAppListVisible() const { |
| 404 return [[window_controller_ window] isVisible] && | 405 return [[window_controller_ window] isVisible] && |
| 405 ![animation_controller_ isClosing]; | 406 ![animation_controller_ isClosing]; |
| 406 } | 407 } |
| 407 | 408 |
| 408 void AppListServiceMac::CreateShortcut() { | 409 void AppListServiceMac::CreateShortcut() { |
| 409 CreateAppListShim(GetProfilePath( | 410 CreateAppListShim(GetProfilePath( |
| 410 g_browser_process->profile_manager()->user_data_dir())); | 411 g_browser_process->profile_manager()->user_data_dir())); |
| 411 } | 412 } |
| 412 | 413 |
| 414 void AppListServiceMac::EnableAppList(Profile* initial_profile) { |
| 415 AppListServiceImpl::EnableAppList(initial_profile); |
| 416 AppController* controller = [NSApp delegate]; |
| 417 [controller initAppShimMenuController]; |
| 418 } |
| 419 |
| 413 NSWindow* AppListServiceMac::GetAppListWindow() { | 420 NSWindow* AppListServiceMac::GetAppListWindow() { |
| 414 return [window_controller_ window]; | 421 return [window_controller_ window]; |
| 415 } | 422 } |
| 416 | 423 |
| 417 AppListControllerDelegate* AppListServiceMac::CreateControllerDelegate() { | 424 AppListControllerDelegate* AppListServiceMac::CreateControllerDelegate() { |
| 418 return new AppListControllerDelegateImpl(this); | 425 return new AppListControllerDelegateImpl(this); |
| 419 } | 426 } |
| 420 | 427 |
| 421 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, | 428 void AppListServiceMac::OnShimLaunch(apps::AppShimHandler::Host* host, |
| 422 apps::AppShimLaunchType launch_type, | 429 apps::AppShimLaunchType launch_type, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 525 |
| 519 - (void)animationDidEnd:(NSAnimation*)animation { | 526 - (void)animationDidEnd:(NSAnimation*)animation { |
| 520 [window_ close]; | 527 [window_ close]; |
| 521 window_.reset(); | 528 window_.reset(); |
| 522 animation_.reset(); | 529 animation_.reset(); |
| 523 | 530 |
| 524 apps::AppShimHandler::MaybeTerminate(); | 531 apps::AppShimHandler::MaybeTerminate(); |
| 525 } | 532 } |
| 526 | 533 |
| 527 @end | 534 @end |
| OLD | NEW |