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/callback.h" | 10 #include "base/callback.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" | |
21 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_info_cache.h" | 21 #include "chrome/browser/profiles/profile_info_cache.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/sync/profile_sync_service.h" | 23 #include "chrome/browser/sync/profile_sync_service.h" |
25 #include "chrome/browser/sync/sync_setup_flow.h" | 24 #include "chrome/browser/sync/sync_setup_flow.h" |
26 #include "chrome/browser/sync/sync_ui_util.h" | 25 #include "chrome/browser/sync/sync_ui_util.h" |
27 #include "chrome/browser/themes/theme_service.h" | 26 #include "chrome/browser/themes/theme_service.h" |
28 #include "chrome/browser/themes/theme_service_factory.h" | 27 #include "chrome/browser/themes/theme_service_factory.h" |
29 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
30 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 DCHECK(localized_strings); | 71 DCHECK(localized_strings); |
73 | 72 |
74 RegisterTitle(localized_strings, "personalPage", | 73 RegisterTitle(localized_strings, "personalPage", |
75 IDS_OPTIONS_CONTENT_TAB_LABEL); | 74 IDS_OPTIONS_CONTENT_TAB_LABEL); |
76 | 75 |
77 | 76 |
78 localized_strings->SetString( | 77 localized_strings->SetString( |
79 "syncOverview", | 78 "syncOverview", |
80 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, | 79 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, |
81 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 80 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 81 localized_strings->SetString( |
| 82 "syncFurtherOverview", |
| 83 l10n_util::GetStringUTF16(IDS_SYNC_FURTHER_OVERVIEW)); |
82 localized_strings->SetString("syncSection", | 84 localized_strings->SetString("syncSection", |
83 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)); | 85 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)); |
84 localized_strings->SetString("customizeSync", | 86 localized_strings->SetString("customizeSync", |
85 l10n_util::GetStringUTF16(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL)); | 87 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 is_start_stop_button_visible = true; | 252 is_start_stop_button_visible = true; |
253 #endif // defined(OS_CHROMEOS) | 253 #endif // defined(OS_CHROMEOS) |
254 is_start_stop_button_enabled = !managed; | 254 is_start_stop_button_enabled = !managed; |
255 } else if (service->SetupInProgress()) { | 255 } else if (service->SetupInProgress()) { |
256 start_stop_button_label = | 256 start_stop_button_label = |
257 l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); | 257 l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); |
258 is_start_stop_button_visible = true; | 258 is_start_stop_button_visible = true; |
259 is_start_stop_button_enabled = false; | 259 is_start_stop_button_enabled = false; |
260 } else { | 260 } else { |
261 start_stop_button_label = | 261 start_stop_button_label = |
262 l10n_util::GetStringFUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL, | 262 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); |
263 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | |
264 is_start_stop_button_visible = true; | 263 is_start_stop_button_visible = true; |
265 is_start_stop_button_enabled = !managed; | 264 is_start_stop_button_enabled = !managed; |
266 } | 265 } |
267 | 266 |
268 scoped_ptr<Value> completed(Value::CreateBooleanValue(sync_setup_completed)); | 267 scoped_ptr<Value> completed(Value::CreateBooleanValue(sync_setup_completed)); |
269 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncSetupCompleted", | 268 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncSetupCompleted", |
270 *completed); | 269 *completed); |
271 | 270 |
272 scoped_ptr<Value> label(Value::CreateStringValue(status_label)); | 271 scoped_ptr<Value> label(Value::CreateStringValue(status_label)); |
273 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatus", *label); | 272 web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatus", *label); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 profile_info_list.Append(profile_value); | 396 profile_info_list.Append(profile_value); |
398 } | 397 } |
399 | 398 |
400 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", | 399 web_ui_->CallJavascriptFunction("PersonalOptions.setProfilesInfo", |
401 profile_info_list); | 400 profile_info_list); |
402 } | 401 } |
403 | 402 |
404 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { | 403 void PersonalOptionsHandler::CreateProfile(const ListValue* args) { |
405 ProfileManager::CreateMultiProfileAsync(); | 404 ProfileManager::CreateMultiProfileAsync(); |
406 } | 405 } |
OLD | NEW |