OLD | NEW |
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/browser/ui/webui/options/personal_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/personal_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 void PersonalOptionsHandler::OnStateChanged() { | 243 void PersonalOptionsHandler::OnStateChanged() { |
244 string16 status_label; | 244 string16 status_label; |
245 string16 link_label; | 245 string16 link_label; |
246 ProfileSyncService* service = | 246 ProfileSyncService* service = |
247 Profile::FromWebUI(web_ui_)->GetProfileSyncService(); | 247 Profile::FromWebUI(web_ui_)->GetProfileSyncService(); |
248 DCHECK(service); | 248 DCHECK(service); |
249 bool managed = service->IsManaged(); | 249 bool managed = service->IsManaged(); |
250 bool sync_setup_completed = service->HasSyncSetupCompleted(); | 250 bool sync_setup_completed = service->HasSyncSetupCompleted(); |
251 bool status_has_error = sync_ui_util::GetStatusLabels( | 251 bool status_has_error = sync_ui_util::GetStatusLabels( |
252 service, &status_label, &link_label) == sync_ui_util::SYNC_ERROR; | 252 service, &status_label, &link_label, true) == sync_ui_util::SYNC_ERROR; |
253 | 253 |
254 string16 start_stop_button_label; | 254 string16 start_stop_button_label; |
255 bool is_start_stop_button_visible = false; | 255 bool is_start_stop_button_visible = false; |
256 bool is_start_stop_button_enabled = false; | 256 bool is_start_stop_button_enabled = false; |
257 if (sync_setup_completed) { | 257 if (sync_setup_completed) { |
258 start_stop_button_label = | 258 start_stop_button_label = |
259 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL); | 259 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL); |
260 #if defined(OS_CHROMEOS) | 260 #if defined(OS_CHROMEOS) |
261 is_start_stop_button_visible = false; | 261 is_start_stop_button_visible = false; |
262 #else | 262 #else |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 profile_info_list.Append(profile_value); | 408 profile_info_list.Append(profile_value); |
409 } | 409 } |
410 | 410 |
411 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 411 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
412 profile_info_list); | 412 profile_info_list); |
413 } | 413 } |
414 | 414 |
415 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 415 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
416 ProfileManager::CreateMultiProfileAsync(); | 416 ProfileManager::CreateMultiProfileAsync(); |
417 } | 417 } |
OLD | NEW |