Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/certificate_manager_handler.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698