| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "base/value_conversions.h" | 16 #include "base/value_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/google/google_util.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_info_cache.h" | 22 #include "chrome/browser/profiles/profile_info_cache.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
| 24 #include "chrome/browser/sync/sync_setup_flow.h" | 25 #include "chrome/browser/sync/sync_setup_flow.h" |
| 25 #include "chrome/browser/sync/sync_ui_util.h" | 26 #include "chrome/browser/sync/sync_ui_util.h" |
| 26 #include "chrome/browser/themes/theme_service.h" | 27 #include "chrome/browser/themes/theme_service.h" |
| 27 #include "chrome/browser/themes/theme_service_factory.h" | 28 #include "chrome/browser/themes/theme_service_factory.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DCHECK(localized_strings); | 72 DCHECK(localized_strings); |
| 72 | 73 |
| 73 RegisterTitle(localized_strings, "personalPage", | 74 RegisterTitle(localized_strings, "personalPage", |
| 74 IDS_OPTIONS_CONTENT_TAB_LABEL); | 75 IDS_OPTIONS_CONTENT_TAB_LABEL); |
| 75 | 76 |
| 76 | 77 |
| 77 localized_strings->SetString( | 78 localized_strings->SetString( |
| 78 "syncOverview", | 79 "syncOverview", |
| 79 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, | 80 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, |
| 80 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 81 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 81 localized_strings->SetString( | |
| 82 "syncFurtherOverview", | |
| 83 l10n_util::GetStringUTF16(IDS_SYNC_FURTHER_OVERVIEW)); | |
| 84 localized_strings->SetString("syncSection", | 82 localized_strings->SetString("syncSection", |
| 85 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)); | 83 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)); |
| 86 localized_strings->SetString("customizeSync", | 84 localized_strings->SetString("customizeSync", |
| 87 l10n_util::GetStringUTF16(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL)); | 85 l10n_util::GetStringUTF16(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL)); |
| 86 localized_strings->SetString("syncLearnMoreURL", |
| 87 google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL)); |
| 88 | 88 |
| 89 localized_strings->SetString("profiles", | 89 localized_strings->SetString("profiles", |
| 90 l10n_util::GetStringUTF16(IDS_PROFILES_OPTIONS_GROUP_NAME)); | 90 l10n_util::GetStringUTF16(IDS_PROFILES_OPTIONS_GROUP_NAME)); |
| 91 localized_strings->SetString("profilesCreate", | 91 localized_strings->SetString("profilesCreate", |
| 92 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_BUTTON_LABEL)); | 92 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_BUTTON_LABEL)); |
| 93 localized_strings->SetString("profilesManage", | 93 localized_strings->SetString("profilesManage", |
| 94 l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_BUTTON_LABEL)); | 94 l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_BUTTON_LABEL)); |
| 95 localized_strings->SetString("profilesDelete", | 95 localized_strings->SetString("profilesDelete", |
| 96 l10n_util::GetStringUTF16(IDS_PROFILES_DELETE_BUTTON_LABEL)); | 96 l10n_util::GetStringUTF16(IDS_PROFILES_DELETE_BUTTON_LABEL)); |
| 97 localized_strings->SetString("profilesListItemCurrent", | 97 localized_strings->SetString("profilesListItemCurrent", |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 is_start_stop_button_visible = true; | 258 is_start_stop_button_visible = true; |
| 259 #endif // defined(OS_CHROMEOS) | 259 #endif // defined(OS_CHROMEOS) |
| 260 is_start_stop_button_enabled = !managed; | 260 is_start_stop_button_enabled = !managed; |
| 261 } else if (service->SetupInProgress()) { | 261 } else if (service->SetupInProgress()) { |
| 262 start_stop_button_label = | 262 start_stop_button_label = |
| 263 l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); | 263 l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); |
| 264 is_start_stop_button_visible = true; | 264 is_start_stop_button_visible = true; |
| 265 is_start_stop_button_enabled = false; | 265 is_start_stop_button_enabled = false; |
| 266 } else { | 266 } else { |
| 267 start_stop_button_label = | 267 start_stop_button_label = |
| 268 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); | 268 l10n_util::GetStringFUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL, |
| 269 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 269 is_start_stop_button_visible = true; | 270 is_start_stop_button_visible = true; |
| 270 is_start_stop_button_enabled = !managed; | 271 is_start_stop_button_enabled = !managed; |
| 271 } | 272 } |
| 272 | 273 |
| 273 scoped_ptr<Value> completed(Value::CreateBooleanValue(sync_setup_completed)); | 274 scoped_ptr<Value> completed(Value::CreateBooleanValue(sync_setup_completed)); |
| 274 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncSetupCompleted", | 275 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncSetupCompleted", |
| 275 *completed); | 276 *completed); |
| 276 | 277 |
| 277 scoped_ptr<Value> label(Value::CreateStringValue(status_label)); | 278 scoped_ptr<Value> label(Value::CreateStringValue(status_label)); |
| 278 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatus", *label); | 279 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatus", *label); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 profile_info_list.Append(profile_value); | 403 profile_info_list.Append(profile_value); |
| 403 } | 404 } |
| 404 | 405 |
| 405 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 406 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
| 406 profile_info_list); | 407 profile_info_list); |
| 407 } | 408 } |
| 408 | 409 |
| 409 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 410 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
| 410 ProfileManager::CreateMultiProfileAsync(); | 411 ProfileManager::CreateMultiProfileAsync(); |
| 411 } | 412 } |
| OLD | NEW |