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

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

Issue 12217101: Replace FilePath with base::FilePath in some more top level directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « ui/base/text/text_elider_unittest.cc ('k') | ui/base/win/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 12
13 #if defined(OS_ANDROID) 13 #if defined(OS_ANDROID)
14 #include "base/android/path_utils.h" 14 #include "base/android/path_utils.h"
15 #endif 15 #endif
16 16
17 namespace ui { 17 namespace ui {
18 18
19 bool PathProvider(int key, FilePath* result) { 19 bool PathProvider(int key, base::FilePath* result) {
20 // Assume that we will not need to create the directory if it does not exist. 20 // Assume that we will not need to create the directory if it does not exist.
21 // This flag can be set to true for the cases where we want to create it. 21 // This flag can be set to true for the cases where we want to create it.
22 bool create_dir = false; 22 bool create_dir = false;
23 23
24 FilePath cur; 24 base::FilePath cur;
25 switch (key) { 25 switch (key) {
26 case ui::DIR_LOCALES: 26 case ui::DIR_LOCALES:
27 if (!PathService::Get(base::DIR_MODULE, &cur)) 27 if (!PathService::Get(base::DIR_MODULE, &cur))
28 return false; 28 return false;
29 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
30 // On Mac, locale files are in Contents/Resources, a sibling of the 30 // On Mac, locale files are in Contents/Resources, a sibling of the
31 // App dir. 31 // App dir.
32 cur = cur.DirName(); 32 cur = cur.DirName();
33 cur = cur.Append(FILE_PATH_LITERAL("Resources")); 33 cur = cur.Append(FILE_PATH_LITERAL("Resources"));
34 #elif defined(OS_ANDROID) 34 #elif defined(OS_ANDROID)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « ui/base/text/text_elider_unittest.cc ('k') | ui/base/win/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698