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 |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 | 686 |
687 size_t WebAppShortcutCreator::CreateShortcutsIn( | 687 size_t WebAppShortcutCreator::CreateShortcutsIn( |
688 const std::vector<base::FilePath>& folders) const { | 688 const std::vector<base::FilePath>& folders) const { |
689 size_t succeeded = 0; | 689 size_t succeeded = 0; |
690 | 690 |
691 base::ScopedTempDir scoped_temp_dir; | 691 base::ScopedTempDir scoped_temp_dir; |
692 if (!scoped_temp_dir.CreateUniqueTempDir()) | 692 if (!scoped_temp_dir.CreateUniqueTempDir()) |
693 return 0; | 693 return 0; |
694 | 694 |
695 base::FilePath app_name = GetShortcutBasename(); | 695 base::FilePath app_name = GetShortcutBasename(); |
696 base::FilePath staging_path = scoped_temp_dir.path().Append(app_name); | 696 base::FilePath staging_path = scoped_temp_dir.GetPath().Append(app_name); |
697 if (!BuildShortcut(staging_path)) | 697 if (!BuildShortcut(staging_path)) |
698 return 0; | 698 return 0; |
699 | 699 |
700 for (std::vector<base::FilePath>::const_iterator it = folders.begin(); | 700 for (std::vector<base::FilePath>::const_iterator it = folders.begin(); |
701 it != folders.end(); ++it) { | 701 it != folders.end(); ++it) { |
702 const base::FilePath& dst_path = *it; | 702 const base::FilePath& dst_path = *it; |
703 if (!base::CreateDirectory(dst_path)) { | 703 if (!base::CreateDirectory(dst_path)) { |
704 LOG(ERROR) << "Creating directory " << dst_path.value() << " failed."; | 704 LOG(ERROR) << "Creating directory " << dst_path.value() << " failed."; |
705 return succeeded; | 705 return succeeded; |
706 } | 706 } |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 BuildShortcutInfoFromBundle(*it); | 1176 BuildShortcutInfoFromBundle(*it); |
1177 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info.get(), | 1177 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info.get(), |
1178 extensions::FileHandlersInfo()); | 1178 extensions::FileHandlersInfo()); |
1179 shortcut_creator.DeleteShortcuts(); | 1179 shortcut_creator.DeleteShortcuts(); |
1180 } | 1180 } |
1181 } | 1181 } |
1182 | 1182 |
1183 } // namespace internals | 1183 } // namespace internals |
1184 | 1184 |
1185 } // namespace web_app | 1185 } // namespace web_app |
OLD | NEW |