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

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

Issue 1115033003: resources: Prevent including the same resource in multiple pack files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 5 years, 7 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
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | no next file » | 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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return false; 53 return false;
54 break; 54 break;
55 #if defined(OS_ANDROID) 55 #if defined(OS_ANDROID)
56 case DIR_RESOURCE_PAKS_ANDROID: 56 case DIR_RESOURCE_PAKS_ANDROID:
57 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur)) 57 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur))
58 return false; 58 return false;
59 cur = cur.Append(FILE_PATH_LITERAL("paks")); 59 cur = cur.Append(FILE_PATH_LITERAL("paks"));
60 break; 60 break;
61 #endif 61 #endif
62 case UI_TEST_PAK: 62 case UI_TEST_PAK:
63 #if defined(OS_ANDROID)
64 if (!PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &cur))
65 return false;
66 #else
63 if (!PathService::Get(base::DIR_MODULE, &cur)) 67 if (!PathService::Get(base::DIR_MODULE, &cur))
64 return false; 68 return false;
69 #endif
65 cur = cur.AppendASCII("ui_test.pak"); 70 cur = cur.AppendASCII("ui_test.pak");
66 break; 71 break;
67 default: 72 default:
68 return false; 73 return false;
69 } 74 }
70 75
71 if (create_dir && !base::PathExists(cur) && 76 if (create_dir && !base::PathExists(cur) &&
72 !base::CreateDirectory(cur)) 77 !base::CreateDirectory(cur))
73 return false; 78 return false;
74 79
75 *result = cur; 80 *result = cur;
76 return true; 81 return true;
77 } 82 }
78 83
79 // This cannot be done as a static initializer sadly since Visual Studio will 84 // This cannot be done as a static initializer sadly since Visual Studio will
80 // eliminate this object file if there is no direct entry point into it. 85 // eliminate this object file if there is no direct entry point into it.
81 void RegisterPathProvider() { 86 void RegisterPathProvider() {
82 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 87 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
83 } 88 }
84 89
85 } // namespace ui 90 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698