| 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/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 else | 67 else |
| 68 StartUp(); | 68 StartUp(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ProfileSyncService::InitSettings() { | 71 void ProfileSyncService::InitSettings() { |
| 72 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 72 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 73 | 73 |
| 74 // Override the sync server URL from the command-line, if sync server | 74 // Override the sync server URL from the command-line, if sync server |
| 75 // command-line argument exists. | 75 // command-line argument exists. |
| 76 if (command_line.HasSwitch(switches::kSyncServiceURL)) { | 76 if (command_line.HasSwitch(switches::kSyncServiceURL)) { |
| 77 std::wstring value(command_line.GetSwitchValue(switches::kSyncServiceURL)); | 77 std::string value(command_line.GetSwitchValueASCII( |
| 78 switches::kSyncServiceURL)); |
| 78 if (!value.empty()) { | 79 if (!value.empty()) { |
| 79 GURL custom_sync_url(WideToUTF8(value)); | 80 GURL custom_sync_url(value); |
| 80 if (custom_sync_url.is_valid()) { | 81 if (custom_sync_url.is_valid()) { |
| 81 sync_service_url_ = custom_sync_url; | 82 sync_service_url_ = custom_sync_url; |
| 82 } else { | 83 } else { |
| 83 LOG(WARNING) << "The following sync URL specified at the command-line " | 84 LOG(WARNING) << "The following sync URL specified at the command-line " |
| 84 << "is invalid: " << value; | 85 << "is invalid: " << value; |
| 85 } | 86 } |
| 86 } | 87 } |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 | 90 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 histogram.SetFlags(kUmaTargetedHistogramFlag); | 420 histogram.SetFlags(kUmaTargetedHistogramFlag); |
| 420 histogram.Add(code); | 421 histogram.Add(code); |
| 421 } | 422 } |
| 422 | 423 |
| 423 bool ProfileSyncService::ShouldPushChanges() { | 424 bool ProfileSyncService::ShouldPushChanges() { |
| 424 // True only after all bootstrapping has succeeded: the bookmark model is | 425 // True only after all bootstrapping has succeeded: the bookmark model is |
| 425 // loaded, the sync backend is initialized, the two domains are | 426 // loaded, the sync backend is initialized, the two domains are |
| 426 // consistent with one another, and no unrecoverable error has transpired. | 427 // consistent with one another, and no unrecoverable error has transpired. |
| 427 return change_processor_->IsRunning(); | 428 return change_processor_->IsRunning(); |
| 428 } | 429 } |
| OLD | NEW |