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

Side by Side Diff: ui/base/ui_base_paths.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 #include "ui/base/ui_base_paths.h" 5 #include "ui/base/ui_base_paths.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur)) 56 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur))
57 return false; 57 return false;
58 cur = cur.Append(FILE_PATH_LITERAL("paks")); 58 cur = cur.Append(FILE_PATH_LITERAL("paks"));
59 break; 59 break;
60 #endif 60 #endif
61 default: 61 default:
62 return false; 62 return false;
63 } 63 }
64 64
65 if (create_dir && !base::PathExists(cur) && 65 if (create_dir && !base::PathExists(cur) &&
66 !file_util::CreateDirectory(cur)) 66 !base::CreateDirectory(cur))
67 return false; 67 return false;
68 68
69 *result = cur; 69 *result = cur;
70 return true; 70 return true;
71 } 71 }
72 72
73 // This cannot be done as a static initializer sadly since Visual Studio will 73 // This cannot be done as a static initializer sadly since Visual Studio will
74 // eliminate this object file if there is no direct entry point into it. 74 // eliminate this object file if there is no direct entry point into it.
75 void RegisterPathProvider() { 75 void RegisterPathProvider() {
76 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 76 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
77 } 77 }
78 78
79 } // namespace ui 79 } // namespace ui
OLDNEW
« no previous file with comments | « tools/gn/ninja_toolchain_writer.cc ('k') | ui/surface/accelerated_surface_transformer_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698