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

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 6528028: Cleanup: Make chrome paths code more consistent and use more constants when p... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | « no previous file | chrome/common/chrome_paths_linux.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/chrome_paths.h" 5 #include "chrome/common/chrome_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/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 12 matching lines...) Expand all
23 // File name of the internal Flash plugin on different platforms. 23 // File name of the internal Flash plugin on different platforms.
24 const FilePath::CharType kInternalFlashPluginFileName[] = 24 const FilePath::CharType kInternalFlashPluginFileName[] =
25 #if defined(OS_MACOSX) 25 #if defined(OS_MACOSX)
26 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin"); 26 FILE_PATH_LITERAL("Flash Player Plugin for Chrome.plugin");
27 #elif defined(OS_WIN) 27 #elif defined(OS_WIN)
28 FILE_PATH_LITERAL("gcswf32.dll"); 28 FILE_PATH_LITERAL("gcswf32.dll");
29 #else // OS_LINUX, etc. 29 #else // OS_LINUX, etc.
30 FILE_PATH_LITERAL("libgcflashplayer.so"); 30 FILE_PATH_LITERAL("libgcflashplayer.so");
31 #endif 31 #endif
32 32
33 // File name of the internal PDF plugin on different platforms.
34 const FilePath::CharType kInternalPDFPluginFileName[] =
35 #if defined(OS_WIN)
36 FILE_PATH_LITERAL("pdf.dll");
37 #elif defined(OS_MACOSX)
38 FILE_PATH_LITERAL("PDF.plugin");
39 #else // Linux and Chrome OS
40 FILE_PATH_LITERAL("libpdf.so");
41 #endif
42
43 // File name of the internal NaCl plugin on different platforms.
44 const FilePath::CharType kInternalNaClPluginFileName[] =
45 #if defined(OS_WIN)
46 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll");
47 #elif defined(OS_MACOSX)
48 // TODO(noelallen) Please verify this extention name is correct.
49 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin");
50 #else // Linux and Chrome OS
51 FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so");
52 #endif
53
33 } // namespace 54 } // namespace
34 55
35 namespace chrome { 56 namespace chrome {
36 57
37 // Gets the path for internal plugins. 58 // Gets the path for internal plugins.
38 bool GetInternalPluginsDirectory(FilePath* result) { 59 bool GetInternalPluginsDirectory(FilePath* result) {
39 #if defined(OS_MACOSX) 60 #if defined(OS_MACOSX)
40 // If called from Chrome, get internal plugins from a subdirectory of the 61 // If called from Chrome, get internal plugins from a subdirectory of the
41 // framework. 62 // framework.
42 if (base::mac::AmIBundled()) { 63 if (base::mac::AmIBundled()) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 case chrome::FILE_FLASH_PLUGIN: 244 case chrome::FILE_FLASH_PLUGIN:
224 if (!GetInternalPluginsDirectory(&cur)) 245 if (!GetInternalPluginsDirectory(&cur))
225 return false; 246 return false;
226 cur = cur.Append(kInternalFlashPluginFileName); 247 cur = cur.Append(kInternalFlashPluginFileName);
227 if (!file_util::PathExists(cur)) 248 if (!file_util::PathExists(cur))
228 return false; 249 return false;
229 break; 250 break;
230 case chrome::FILE_PDF_PLUGIN: 251 case chrome::FILE_PDF_PLUGIN:
231 if (!GetInternalPluginsDirectory(&cur)) 252 if (!GetInternalPluginsDirectory(&cur))
232 return false; 253 return false;
233 #if defined(OS_WIN) 254 cur = cur.Append(kInternalPDFPluginFileName);
234 cur = cur.Append(FILE_PATH_LITERAL("pdf.dll"));
235 #elif defined(OS_MACOSX)
236 cur = cur.Append(FILE_PATH_LITERAL("PDF.plugin"));
237 #else // Linux and Chrome OS
238 cur = cur.Append(FILE_PATH_LITERAL("libpdf.so"));
239 #endif
240 break; 255 break;
241 case chrome::FILE_NACL_PLUGIN: 256 case chrome::FILE_NACL_PLUGIN:
242 if (!GetInternalPluginsDirectory(&cur)) 257 if (!GetInternalPluginsDirectory(&cur))
243 return false; 258 return false;
244 #if defined(OS_WIN) 259 cur = cur.Append(kInternalNaClPluginFileName);
245 cur = cur.Append(FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll"));
246 #elif defined(OS_MACOSX)
247 // TODO(noelallen) Please verify this extention name is correct.
248 cur = cur.Append(FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin"));
249 #else // Linux and Chrome OS
250 cur = cur.Append(FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so"));
251 #endif
252 break; 260 break;
253 case chrome::FILE_RESOURCES_PACK: 261 case chrome::FILE_RESOURCES_PACK:
254 #if defined(OS_MACOSX) 262 #if defined(OS_MACOSX)
255 if (base::mac::AmIBundled()) { 263 if (base::mac::AmIBundled()) {
256 cur = base::mac::MainAppBundlePath(); 264 cur = base::mac::MainAppBundlePath();
257 cur = cur.Append(FILE_PATH_LITERAL("Resources")) 265 cur = cur.Append(FILE_PATH_LITERAL("Resources"))
258 .Append(FILE_PATH_LITERAL("resources.pak")); 266 .Append(FILE_PATH_LITERAL("resources.pak"));
259 break; 267 break;
260 } 268 }
261 // If we're not bundled on mac, resources.pak should be next to the 269 // If we're not bundled on mac, resources.pak should be next to the
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 return true; 348 return true;
341 } 349 }
342 350
343 // This cannot be done as a static initializer sadly since Visual Studio will 351 // This cannot be done as a static initializer sadly since Visual Studio will
344 // eliminate this object file if there is no direct entry point into it. 352 // eliminate this object file if there is no direct entry point into it.
345 void RegisterPathProvider() { 353 void RegisterPathProvider() {
346 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 354 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
347 } 355 }
348 356
349 } // namespace chrome 357 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_paths_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698