OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
| 11 #include <utility> |
| 12 |
11 #include "base/command_line.h" | 13 #include "base/command_line.h" |
12 #include "base/files/file_enumerator.h" | 14 #include "base/files/file_enumerator.h" |
13 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
14 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
15 #include "base/mac/foundation_util.h" | 17 #include "base/mac/foundation_util.h" |
16 #include "base/mac/launch_services_util.h" | 18 #include "base/mac/launch_services_util.h" |
17 #include "base/mac/mac_util.h" | 19 #include "base/mac/mac_util.h" |
18 #include "base/mac/scoped_cftyperef.h" | 20 #include "base/mac/scoped_cftyperef.h" |
19 #include "base/mac/scoped_nsobject.h" | 21 #include "base/mac/scoped_nsobject.h" |
20 #include "base/macros.h" | 22 #include "base/macros.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 shortcut_creator.UpdateShortcuts(); | 304 shortcut_creator.UpdateShortcuts(); |
303 } | 305 } |
304 | 306 |
305 void UpdateAndLaunchShimOnFileThread( | 307 void UpdateAndLaunchShimOnFileThread( |
306 scoped_ptr<web_app::ShortcutInfo> shortcut_info, | 308 scoped_ptr<web_app::ShortcutInfo> shortcut_info, |
307 const extensions::FileHandlersInfo& file_handlers_info) { | 309 const extensions::FileHandlersInfo& file_handlers_info) { |
308 base::FilePath shortcut_data_dir = web_app::GetWebAppDataDirectory( | 310 base::FilePath shortcut_data_dir = web_app::GetWebAppDataDirectory( |
309 shortcut_info->profile_path, shortcut_info->extension_id, GURL()); | 311 shortcut_info->profile_path, shortcut_info->extension_id, GURL()); |
310 UpdatePlatformShortcutsInternal(shortcut_data_dir, base::string16(), | 312 UpdatePlatformShortcutsInternal(shortcut_data_dir, base::string16(), |
311 *shortcut_info, file_handlers_info); | 313 *shortcut_info, file_handlers_info); |
312 LaunchShimOnFileThread(shortcut_info.Pass(), true); | 314 LaunchShimOnFileThread(std::move(shortcut_info), true); |
313 } | 315 } |
314 | 316 |
315 void UpdateAndLaunchShim( | 317 void UpdateAndLaunchShim( |
316 scoped_ptr<web_app::ShortcutInfo> shortcut_info, | 318 scoped_ptr<web_app::ShortcutInfo> shortcut_info, |
317 const extensions::FileHandlersInfo& file_handlers_info) { | 319 const extensions::FileHandlersInfo& file_handlers_info) { |
318 content::BrowserThread::PostTask( | 320 content::BrowserThread::PostTask( |
319 content::BrowserThread::FILE, FROM_HERE, | 321 content::BrowserThread::FILE, FROM_HERE, |
320 base::Bind(&UpdateAndLaunchShimOnFileThread, base::Passed(&shortcut_info), | 322 base::Bind(&UpdateAndLaunchShimOnFileThread, base::Passed(&shortcut_info), |
321 file_handlers_info)); | 323 file_handlers_info)); |
322 } | 324 } |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 web_app::GetShortcutInfoForApp( | 1267 web_app::GetShortcutInfoForApp( |
1266 app, | 1268 app, |
1267 profile, | 1269 profile, |
1268 base::Bind(&web_app::CreateAppShortcutInfoLoaded, | 1270 base::Bind(&web_app::CreateAppShortcutInfoLoaded, |
1269 profile, | 1271 profile, |
1270 app, | 1272 app, |
1271 close_callback)); | 1273 close_callback)); |
1272 } | 1274 } |
1273 | 1275 |
1274 } // namespace chrome | 1276 } // namespace chrome |
OLD | NEW |