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" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 shortcut_locations.in_quick_launch_bar = true; | 144 shortcut_locations.in_quick_launch_bar = true; |
145 | 145 |
146 web_app::CreateShortcuts(shortcut_info, | 146 web_app::CreateShortcuts(shortcut_info, |
147 shortcut_locations, | 147 shortcut_locations, |
148 web_app::SHORTCUT_CREATION_AUTOMATED); | 148 web_app::SHORTCUT_CREATION_AUTOMATED); |
149 | 149 |
150 local_state->SetInteger(prefs::kAppLauncherShortcutVersion, | 150 local_state->SetInteger(prefs::kAppLauncherShortcutVersion, |
151 kShortcutVersion); | 151 kShortcutVersion); |
152 } | 152 } |
153 | 153 |
154 void CreateShortcutsInDefaultLocation( | |
155 const ShellIntegration::ShortcutInfo& shortcut_info) { | |
156 web_app::CreateShortcuts(shortcut_info, | |
157 ShellIntegration::ShortcutLocations(), | |
158 web_app::SHORTCUT_CREATION_BY_USER); | |
159 } | |
160 | |
161 NSRunningApplication* ActiveApplicationNotChrome() { | 154 NSRunningApplication* ActiveApplicationNotChrome() { |
162 NSArray* applications = [[NSWorkspace sharedWorkspace] runningApplications]; | 155 NSArray* applications = [[NSWorkspace sharedWorkspace] runningApplications]; |
163 for (NSRunningApplication* application in applications) { | 156 for (NSRunningApplication* application in applications) { |
164 if (![application isActive]) | 157 if (![application isActive]) |
165 continue; | 158 continue; |
166 | 159 |
167 if ([application isEqual:[NSRunningApplication currentApplication]]) | 160 if ([application isEqual:[NSRunningApplication currentApplication]]) |
168 return nil; // Chrome is active. | 161 return nil; // Chrome is active. |
169 | 162 |
170 return application; | 163 return application; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 518 |
526 - (void)animationDidEnd:(NSAnimation*)animation { | 519 - (void)animationDidEnd:(NSAnimation*)animation { |
527 [window_ close]; | 520 [window_ close]; |
528 window_.reset(); | 521 window_.reset(); |
529 animation_.reset(); | 522 animation_.reset(); |
530 | 523 |
531 apps::AppShimHandler::MaybeTerminate(); | 524 apps::AppShimHandler::MaybeTerminate(); |
532 } | 525 } |
533 | 526 |
534 @end | 527 @end |
OLD | NEW |