| 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 | 9 |
| 10 #include "apps/app_shim/app_shim_mac.h" | 10 #include "apps/app_shim/app_shim_mac.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 base::FilePath GetWritableApplicationsDirectory() { | 139 base::FilePath GetWritableApplicationsDirectory() { |
| 140 base::FilePath path; | 140 base::FilePath path; |
| 141 if (base::mac::GetUserDirectory(NSApplicationDirectory, &path)) { | 141 if (base::mac::GetUserDirectory(NSApplicationDirectory, &path)) { |
| 142 if (!base::DirectoryExists(path)) { | 142 if (!base::DirectoryExists(path)) { |
| 143 if (!base::CreateDirectory(path)) | 143 if (!base::CreateDirectory(path)) |
| 144 return base::FilePath(); | 144 return base::FilePath(); |
| 145 | 145 |
| 146 // Create a zero-byte ".localized" file to inherit localizations from OSX | 146 // Create a zero-byte ".localized" file to inherit localizations from OSX |
| 147 // for folders that have special meaning. | 147 // for folders that have special meaning. |
| 148 file_util::WriteFile(path.Append(".localized"), NULL, 0); | 148 base::WriteFile(path.Append(".localized"), NULL, 0); |
| 149 } | 149 } |
| 150 return base::PathIsWritable(path) ? path : base::FilePath(); | 150 return base::PathIsWritable(path) ? path : base::FilePath(); |
| 151 } | 151 } |
| 152 return base::FilePath(); | 152 return base::FilePath(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Given the path to an app bundle, return the resources directory. | 155 // Given the path to an app bundle, return the resources directory. |
| 156 base::FilePath GetResourcesPath(const base::FilePath& app_path) { | 156 base::FilePath GetResourcesPath(const base::FilePath& app_path) { |
| 157 return app_path.Append("Contents").Append("Resources"); | 157 return app_path.Append("Contents").Append("Resources"); |
| 158 } | 158 } |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 ShellIntegration::ShortcutInfo shortcut_info = | 856 ShellIntegration::ShortcutInfo shortcut_info = |
| 857 BuildShortcutInfoFromBundle(*it); | 857 BuildShortcutInfoFromBundle(*it); |
| 858 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info); | 858 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info); |
| 859 shortcut_creator.DeleteShortcuts(); | 859 shortcut_creator.DeleteShortcuts(); |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 | 862 |
| 863 } // namespace internals | 863 } // namespace internals |
| 864 | 864 |
| 865 } // namespace web_app | 865 } // namespace web_app |
| OLD | NEW |