| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 virtual bool CanDoCreateShortcutsFlow(bool is_platform_app) OVERRIDE; | 139 virtual bool CanDoCreateShortcutsFlow(bool is_platform_app) OVERRIDE; |
| 140 virtual void CreateNewWindow(Profile* profile, bool incognito) OVERRIDE; | 140 virtual void CreateNewWindow(Profile* profile, bool incognito) OVERRIDE; |
| 141 virtual void DoCreateShortcutsFlow(Profile* profile, | 141 virtual void DoCreateShortcutsFlow(Profile* profile, |
| 142 const std::string& extension_id) OVERRIDE; | 142 const std::string& extension_id) OVERRIDE; |
| 143 virtual void ActivateApp(Profile* profile, | 143 virtual void ActivateApp(Profile* profile, |
| 144 const extensions::Extension* extension, | 144 const extensions::Extension* extension, |
| 145 int event_flags) OVERRIDE; | 145 int event_flags) OVERRIDE; |
| 146 virtual void LaunchApp(Profile* profile, | 146 virtual void LaunchApp(Profile* profile, |
| 147 const extensions::Extension* extension, | 147 const extensions::Extension* extension, |
| 148 int event_flags) OVERRIDE; | 148 int event_flags) OVERRIDE; |
| 149 virtual void ShowForProfileByPath( |
| 150 const base::FilePath& profile_path) OVERRIDE; |
| 149 | 151 |
| 150 DISALLOW_COPY_AND_ASSIGN(AppListControllerDelegateCocoa); | 152 DISALLOW_COPY_AND_ASSIGN(AppListControllerDelegateCocoa); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 ShellIntegration::ShortcutInfo GetAppListShortcutInfo( | 155 ShellIntegration::ShortcutInfo GetAppListShortcutInfo( |
| 154 const base::FilePath& profile_path) { | 156 const base::FilePath& profile_path) { |
| 155 ShellIntegration::ShortcutInfo shortcut_info; | 157 ShellIntegration::ShortcutInfo shortcut_info; |
| 156 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 158 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 157 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { | 159 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { |
| 158 shortcut_info.title = | 160 shortcut_info.title = |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 Profile* profile, const extensions::Extension* extension, int event_flags) { | 312 Profile* profile, const extensions::Extension* extension, int event_flags) { |
| 311 LaunchApp(profile, extension, event_flags); | 313 LaunchApp(profile, extension, event_flags); |
| 312 } | 314 } |
| 313 | 315 |
| 314 void AppListControllerDelegateCocoa::LaunchApp( | 316 void AppListControllerDelegateCocoa::LaunchApp( |
| 315 Profile* profile, const extensions::Extension* extension, int event_flags) { | 317 Profile* profile, const extensions::Extension* extension, int event_flags) { |
| 316 chrome::OpenApplication(chrome::AppLaunchParams( | 318 chrome::OpenApplication(chrome::AppLaunchParams( |
| 317 profile, extension, NEW_FOREGROUND_TAB)); | 319 profile, extension, NEW_FOREGROUND_TAB)); |
| 318 } | 320 } |
| 319 | 321 |
| 322 void AppListControllerDelegateCocoa::ShowForProfileByPath( |
| 323 const base::FilePath& profile_path) { |
| 324 // TODO(tapted): Implement this for Mac. |
| 325 } |
| 326 |
| 320 AppListServiceMac::AppListServiceMac() { | 327 AppListServiceMac::AppListServiceMac() { |
| 321 animation_controller_.reset([[AppListAnimationController alloc] init]); | 328 animation_controller_.reset([[AppListAnimationController alloc] init]); |
| 322 } | 329 } |
| 323 | 330 |
| 324 AppListServiceMac::~AppListServiceMac() {} | 331 AppListServiceMac::~AppListServiceMac() {} |
| 325 | 332 |
| 326 void AppListServiceMac::Init(Profile* initial_profile) { | 333 void AppListServiceMac::Init(Profile* initial_profile) { |
| 327 // On Mac, Init() is called multiple times for a process: any time there is no | 334 // On Mac, Init() is called multiple times for a process: any time there is no |
| 328 // browser window open and a new window is opened, and during process startup | 335 // browser window open and a new window is opened, and during process startup |
| 329 // to handle the silent launch case (e.g. for app shims). In the startup case, | 336 // to handle the silent launch case (e.g. for app shims). In the startup case, |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 654 |
| 648 // static | 655 // static |
| 649 AppListService* AppListService::Get() { | 656 AppListService* AppListService::Get() { |
| 650 return AppListServiceMac::GetInstance(); | 657 return AppListServiceMac::GetInstance(); |
| 651 } | 658 } |
| 652 | 659 |
| 653 // static | 660 // static |
| 654 void AppListService::InitAll(Profile* initial_profile) { | 661 void AppListService::InitAll(Profile* initial_profile) { |
| 655 Get()->Init(initial_profile); | 662 Get()->Init(initial_profile); |
| 656 } | 663 } |
| OLD | NEW |