| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 [animation_controller_ animateWindow:[window_controller_ window] | 399 [animation_controller_ animateWindow:[window_controller_ window] |
| 399 targetOrigin:last_start_origin_ | 400 targetOrigin:last_start_origin_ |
| 400 closing:YES]; | 401 closing:YES]; |
| 401 } | 402 } |
| 402 | 403 |
| 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 |
| 409 void AppListServiceMac::EnableAppList(Profile* initial_profile) { |
| 410 AppListServiceImpl::EnableAppList(initial_profile); |
| 411 AppController* controller = [NSApp delegate]; |
| 412 [controller initAppShimMenuController]; |
| 413 } |
| 414 |
| 408 void AppListServiceMac::CreateShortcut() { | 415 void AppListServiceMac::CreateShortcut() { |
| 409 CreateAppListShim(GetProfilePath( | 416 CreateAppListShim(GetProfilePath( |
| 410 g_browser_process->profile_manager()->user_data_dir())); | 417 g_browser_process->profile_manager()->user_data_dir())); |
| 411 } | 418 } |
| 412 | 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() { |
| (...skipping 100 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 |