| 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 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| 11 #include <utility> |
| 12 |
| 11 #include "base/bind.h" | 13 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 13 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 14 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 15 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
| 16 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 17 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
| 18 #import "chrome/browser/app_controller_mac.h" | 20 #import "chrome/browser/app_controller_mac.h" |
| 19 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 int installed_version = | 146 int installed_version = |
| 145 local_state->GetInteger(prefs::kAppLauncherShortcutVersion); | 147 local_state->GetInteger(prefs::kAppLauncherShortcutVersion); |
| 146 | 148 |
| 147 // If this is a first-time install, add a dock icon. Otherwise just update | 149 // If this is a first-time install, add a dock icon. Otherwise just update |
| 148 // the target, and wait for OSX to refresh its icon caches. This might not | 150 // the target, and wait for OSX to refresh its icon caches. This might not |
| 149 // occur until a reboot, but OSX does not offer a nicer way. Deleting cache | 151 // occur until a reboot, but OSX does not offer a nicer way. Deleting cache |
| 150 // files on disk and killing processes can easily result in icon corruption. | 152 // files on disk and killing processes can easily result in icon corruption. |
| 151 if (installed_version == 0) | 153 if (installed_version == 0) |
| 152 shortcut_locations.in_quick_launch_bar = true; | 154 shortcut_locations.in_quick_launch_bar = true; |
| 153 | 155 |
| 154 web_app::CreateNonAppShortcut(shortcut_locations, shortcut_info.Pass()); | 156 web_app::CreateNonAppShortcut(shortcut_locations, std::move(shortcut_info)); |
| 155 | 157 |
| 156 local_state->SetInteger(prefs::kAppLauncherShortcutVersion, | 158 local_state->SetInteger(prefs::kAppLauncherShortcutVersion, |
| 157 kShortcutVersion); | 159 kShortcutVersion); |
| 158 } | 160 } |
| 159 | 161 |
| 160 NSRunningApplication* ActiveApplicationNotChrome() { | 162 NSRunningApplication* ActiveApplicationNotChrome() { |
| 161 NSArray* applications = [[NSWorkspace sharedWorkspace] runningApplications]; | 163 NSArray* applications = [[NSWorkspace sharedWorkspace] runningApplications]; |
| 162 for (NSRunningApplication* application in applications) { | 164 for (NSRunningApplication* application in applications) { |
| 163 if (![application isActive]) | 165 if (![application isActive]) |
| 164 continue; | 166 continue; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 581 |
| 580 - (void)animationDidEnd:(NSAnimation*)animation { | 582 - (void)animationDidEnd:(NSAnimation*)animation { |
| 581 content::BrowserThread::PostTask( | 583 content::BrowserThread::PostTask( |
| 582 content::BrowserThread::UI, | 584 content::BrowserThread::UI, |
| 583 FROM_HERE, | 585 FROM_HERE, |
| 584 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, | 586 base::Bind(&AppListServiceMac::WindowAnimationDidEnd, |
| 585 base::Unretained(GetActiveInstance()))); | 587 base::Unretained(GetActiveInstance()))); |
| 586 } | 588 } |
| 587 | 589 |
| 588 @end | 590 @end |
| OLD | NEW |