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

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

Issue 7839009: BUG=94920 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « chrome/common/chrome_paths.h ('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) 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 cur = cur.Append(FILE_PATH_LITERAL("Extensions")); 346 cur = cur.Append(FILE_PATH_LITERAL("Extensions"));
347 create_dir = false; 347 create_dir = false;
348 #else 348 #else
349 if (!PathService::Get(base::DIR_MODULE, &cur)) 349 if (!PathService::Get(base::DIR_MODULE, &cur))
350 return false; 350 return false;
351 351
352 cur = cur.Append(FILE_PATH_LITERAL("extensions")); 352 cur = cur.Append(FILE_PATH_LITERAL("extensions"));
353 create_dir = true; 353 create_dir = true;
354 #endif 354 #endif
355 break; 355 break;
356 case chrome::DIR_DEFAULT_APPS:
357 #if defined(OS_MACOSX)
358 cur = base::mac::MainAppBundlePath();
359 cur = cur.Append(FILE_PATH_LITERAL("Default Apps"));
360 #else
361 if (!PathService::Get(chrome::DIR_APP, &cur))
362 return false;
363 cur = cur.Append(FILE_PATH_LITERAL("default_apps"));
364 #endif
365 break;
356 default: 366 default:
357 return false; 367 return false;
358 } 368 }
359 369
360 if (create_dir && !file_util::PathExists(cur) && 370 if (create_dir && !file_util::PathExists(cur) &&
361 !file_util::CreateDirectory(cur)) 371 !file_util::CreateDirectory(cur))
362 return false; 372 return false;
363 373
364 *result = cur; 374 *result = cur;
365 return true; 375 return true;
366 } 376 }
367 377
368 // This cannot be done as a static initializer sadly since Visual Studio will 378 // This cannot be done as a static initializer sadly since Visual Studio will
369 // eliminate this object file if there is no direct entry point into it. 379 // eliminate this object file if there is no direct entry point into it.
370 void RegisterPathProvider() { 380 void RegisterPathProvider() {
371 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 381 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
372 } 382 }
373 383
374 } // namespace chrome 384 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698