OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser/profile.h" | 5 #include "chrome/browser/profile.h" |
6 | 6 |
7 #include "app/theme_provider.h" | 7 #include "app/theme_provider.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 DCHECK(max_size); | 85 DCHECK(max_size); |
86 | 86 |
87 // Override the cache location if specified by the user. | 87 // Override the cache location if specified by the user. |
88 std::wstring user_path(CommandLine::ForCurrentProcess()->GetSwitchValue( | 88 std::wstring user_path(CommandLine::ForCurrentProcess()->GetSwitchValue( |
89 switches::kDiskCacheDir)); | 89 switches::kDiskCacheDir)); |
90 | 90 |
91 if (!user_path.empty()) { | 91 if (!user_path.empty()) { |
92 *cache_path = FilePath::FromWStringHack(user_path); | 92 *cache_path = FilePath::FromWStringHack(user_path); |
93 } | 93 } |
94 | 94 |
95 const wchar_t* arg = kNormalContext == type ? switches::kDiskCacheSize : | 95 const char* arg = kNormalContext == type ? switches::kDiskCacheSize : |
96 switches::kMediaCacheSize; | 96 switches::kMediaCacheSize; |
97 std::string value = | 97 std::string value = |
98 WideToASCII(CommandLine::ForCurrentProcess()->GetSwitchValue(arg)); | 98 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(arg); |
99 | 99 |
100 // By default we let the cache determine the right size. | 100 // By default we let the cache determine the right size. |
101 *max_size = 0; | 101 *max_size = 0; |
102 if (!StringToInt(value, max_size)) { | 102 if (!StringToInt(value, max_size)) { |
103 *max_size = 0; | 103 *max_size = 0; |
104 } else if (max_size < 0) { | 104 } else if (max_size < 0) { |
105 *max_size = 0; | 105 *max_size = 0; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 #endif | 1391 #endif |
1392 return NULL; | 1392 return NULL; |
1393 } | 1393 } |
1394 | 1394 |
1395 void ProfileImpl::InitSyncService() { | 1395 void ProfileImpl::InitSyncService() { |
1396 #ifdef CHROME_PERSONALIZATION | 1396 #ifdef CHROME_PERSONALIZATION |
1397 sync_service_.reset(new ProfileSyncService(this)); | 1397 sync_service_.reset(new ProfileSyncService(this)); |
1398 sync_service_->Initialize(); | 1398 sync_service_->Initialize(); |
1399 #endif | 1399 #endif |
1400 } | 1400 } |
OLD | NEW |