summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorsargrass@google.com <sargrass@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 18:26:11 +0000
committersargrass@google.com <sargrass@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 18:26:11 +0000
commit273567eef4c182233fa5cfe25d6e229ce004f3c9 (patch)
tree8e1b459f52872769364815f01a5137e4cbf68d82 /chrome/browser/dom_ui
parentea965f3731a65e5ba8567c71673a021b70ed1762 (diff)
downloadchromium_src-273567eef4c182233fa5cfe25d6e229ce004f3c9.zip
chromium_src-273567eef4c182233fa5cfe25d6e229ce004f3c9.tar.gz
chromium_src-273567eef4c182233fa5cfe25d6e229ce004f3c9.tar.bz2
Relanding: Personal stuff page in tabbed options
Relanding issue 2819046 BUG=48883 TEST=Exercise Personal Stuff page via --enable-tabbed-options Review URL: http://codereview.chromium.org/3042005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/options_ui.cc5
-rw-r--r--chrome/browser/dom_ui/personal_options_handler.cc91
-rw-r--r--chrome/browser/dom_ui/sync_options_handler.cc49
-rw-r--r--chrome/browser/dom_ui/sync_options_handler.h23
4 files changed, 143 insertions, 25 deletions
diff --git a/chrome/browser/dom_ui/options_ui.cc b/chrome/browser/dom_ui/options_ui.cc
index 3305df3..4121d91 100644
--- a/chrome/browser/dom_ui/options_ui.cc
+++ b/chrome/browser/dom_ui/options_ui.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/dom_ui/core_options_handler.h"
#include "chrome/browser/dom_ui/font_settings_handler.h"
#include "chrome/browser/dom_ui/personal_options_handler.h"
+#include "chrome/browser/dom_ui/sync_options_handler.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
@@ -47,7 +48,6 @@
#include "chrome/browser/chromeos/dom_ui/labs_handler.h"
#include "chrome/browser/chromeos/dom_ui/language_hangul_options_handler.h"
#include "chrome/browser/chromeos/dom_ui/language_options_handler.h"
-#include "chrome/browser/chromeos/dom_ui/sync_options_handler.h"
#include "chrome/browser/chromeos/dom_ui/system_options_handler.h"
#endif
@@ -119,10 +119,11 @@ OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) {
// TODO(zelidrag): Add all other page handlers here as we implement them.
AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler());
AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler());
+ AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler());
AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler());
+ AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler());
#if defined(OS_CHROMEOS)
AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler());
- AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler());
AddOptionsPageUIHandler(localized_strings, new LabsHandler());
AddOptionsPageUIHandler(localized_strings,
new LanguageHangulOptionsHandler());
diff --git a/chrome/browser/dom_ui/personal_options_handler.cc b/chrome/browser/dom_ui/personal_options_handler.cc
index c0f13b8..1db6a8a 100644
--- a/chrome/browser/dom_ui/personal_options_handler.cc
+++ b/chrome/browser/dom_ui/personal_options_handler.cc
@@ -5,10 +5,24 @@
#include "chrome/browser/dom_ui/personal_options_handler.h"
#include "app/l10n_util.h"
+#include "app/resource_bundle.h"
#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/path_service.h"
+#include "base/stl_util-inl.h"
+#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/common/notification_service.h"
+#include "chrome/common/chrome_paths.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profile.h"
+#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/sync/profile_sync_service.h"
+#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
+#include "grit/theme_resources.h"
PersonalOptionsHandler::PersonalOptionsHandler() {
}
@@ -18,43 +32,74 @@ PersonalOptionsHandler::~PersonalOptionsHandler() {
void PersonalOptionsHandler::GetLocalizedValues(
DictionaryValue* localized_strings) {
+ FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ Profile* profile = profile_manager->GetDefaultProfile(user_data_dir);
+ ProfileSyncService* service = profile->GetProfileSyncService();
+
DCHECK(localized_strings);
- localized_strings->SetString(L"passwordsGroupName",
+ //Personal Stuff page
+ localized_strings->SetString(L"sync_section",
+ l10n_util::GetString(IDS_SYNC_OPTIONS_GROUP_NAME));
+ localized_strings->SetString(L"sync_not_setup_info",
+ l10n_util::GetStringF(IDS_SYNC_NOT_SET_UP_INFO,
+ l10n_util::GetString(IDS_PRODUCT_NAME)));
+ localized_strings->SetString(L"start_sync",
+ l10n_util::GetString(IDS_SYNC_START_SYNC_BUTTON_LABEL));
+ localized_strings->SetString(L"synced_to_user_with_time",
+ l10n_util::GetStringF(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME,
+ UTF16ToWide(service->GetAuthenticatedUsername()),
+ service->GetLastSyncedTimeString()));
+ localized_strings->SetString(L"sync_customize",
+ l10n_util::GetString(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL));
+ localized_strings->SetString(L"stop_sync",
+ l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL));
+
+ localized_strings->SetString(L"passwords",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_GROUP_NAME));
- localized_strings->SetString(L"passwordsAskToSave",
+ localized_strings->SetString(L"passwords_asktosave",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE));
- localized_strings->SetString(L"passwordsNeverSave",
+ localized_strings->SetString(L"passwords_neversave",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE));
- localized_strings->SetString(L"passwordShowPasswords",
+ localized_strings->SetString(L"showpasswords",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS));
- localized_strings->SetString(L"autoFillSettingWindowsGroupName",
+
+ localized_strings->SetString(L"autofill",
l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME));
- localized_strings->SetString(L"autoFillEnable",
+ localized_strings->SetString(L"autofill_enable",
l10n_util::GetString(IDS_OPTIONS_AUTOFILL_ENABLE));
- localized_strings->SetString(L"autoFillDisable",
+ localized_strings->SetString(L"autofill_disable",
l10n_util::GetString(IDS_OPTIONS_AUTOFILL_DISABLE));
- localized_strings->SetString(L"themesGroupName",
- l10n_util::GetString(IDS_THEMES_GROUP_NAME));
+ localized_strings->SetString(L"autofill_options",
+ l10n_util::GetString(IDS_AUTOFILL_OPTIONS));
+
+ localized_strings->SetString(L"browsing_data",
+ l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME));
+ localized_strings->SetString(L"import_data",
+ l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_BUTTON));
+
#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
- localized_strings->SetString(L"appearanceGroupName",
+ localized_strings->SetString(L"appearance",
l10n_util::GetString(IDS_APPEARANCE_GROUP_NAME));
- localized_strings->SetString(L"themesGTKButton",
+ localized_strings->SetString(L"themes_GTK_button",
l10n_util::GetString(IDS_THEMES_GTK_BUTTON));
- localized_strings->SetString(L"themesSetClassic",
+ localized_strings->SetString(L"themes_set_classic",
l10n_util::GetString(IDS_THEMES_SET_CLASSIC));
- localized_strings->SetString(L"showWindowDecorationsRadio",
+ localized_strings->SetString(L"showWindow_decorations_radio",
l10n_util::GetString(IDS_SHOW_WINDOW_DECORATIONS_RADIO));
- localized_strings->SetString(L"hideWindowDecorationsRadio",
+ localized_strings->SetString(L"hideWindow_decorations_radio",
l10n_util::GetString(IDS_HIDE_WINDOW_DECORATIONS_RADIO));
-#endif
- localized_strings->SetString(L"themesResetButton",
+ localized_strings->SetString(L"themes_gallery",
+ l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON));
+#else
+ localized_strings->SetString(L"themes",
+ l10n_util::GetString(IDS_THEMES_GROUP_NAME));
+ localized_strings->SetString(L"themes_reset",
l10n_util::GetString(IDS_THEMES_RESET_BUTTON));
- localized_strings->SetString(L"themesDefaultThemeLabel",
- l10n_util::GetString(IDS_THEMES_DEFAULT_THEME_LABEL));
- localized_strings->SetString(L"themesGalleryButton",
+ localized_strings->SetString(L"themes_gallery",
l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON));
- localized_strings->SetString(L"browsingDataGroupName",
- l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME));
- localized_strings->SetString(L"importDataButton",
- l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_BUTTON));
+ localized_strings->SetString(L"themes_default",
+ l10n_util::GetString(IDS_THEMES_DEFAULT_THEME_LABEL));
+#endif
}
diff --git a/chrome/browser/dom_ui/sync_options_handler.cc b/chrome/browser/dom_ui/sync_options_handler.cc
new file mode 100644
index 0000000..8378a13
--- /dev/null
+++ b/chrome/browser/dom_ui/sync_options_handler.cc
@@ -0,0 +1,49 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/dom_ui/sync_options_handler.h"
+
+#include "app/l10n_util.h"
+#include "app/resource_bundle.h"
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/i18n/time_formatting.h"
+#include "base/stl_util-inl.h"
+#include "base/time.h"
+#include "base/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/common/notification_service.h"
+#include "grit/browser_resources.h"
+#include "grit/chromium_strings.h"
+#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
+#include "grit/theme_resources.h"
+
+SyncOptionsHandler::SyncOptionsHandler() {}
+
+SyncOptionsHandler::~SyncOptionsHandler() {}
+
+void SyncOptionsHandler::GetLocalizedValues(
+ DictionaryValue* localized_strings) {
+ DCHECK(localized_strings);
+ // Sync page - ChromeOS
+ localized_strings->SetString(L"syncPage",
+ l10n_util::GetString(IDS_SYNC_NTP_SYNC_SECTION_TITLE));
+ localized_strings->SetString(L"sync_title",
+ l10n_util::GetString(IDS_CUSTOMIZE_SYNC_DESCRIPTION));
+ localized_strings->SetString(L"syncsettings",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_PREFERENCES));
+ localized_strings->SetString(L"syncbookmarks",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_BOOKMARKS));
+ localized_strings->SetString(L"synctypedurls",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_TYPED_URLS));
+ localized_strings->SetString(L"syncpasswords",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_PASSWORDS));
+ localized_strings->SetString(L"syncextensions",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_EXTENSIONS));
+ localized_strings->SetString(L"syncautofill",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_AUTOFILL));
+ localized_strings->SetString(L"syncthemes",
+ l10n_util::GetString(IDS_SYNC_DATATYPE_THEMES));
+}
diff --git a/chrome/browser/dom_ui/sync_options_handler.h b/chrome/browser/dom_ui/sync_options_handler.h
new file mode 100644
index 0000000..8c7923c
--- /dev/null
+++ b/chrome/browser/dom_ui/sync_options_handler.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DOM_UI_SYNC_OPTIONS_HANDLER_H_
+#define CHROME_BROWSER_DOM_UI_SYNC_OPTIONS_HANDLER_H_
+
+#include "chrome/browser/dom_ui/options_ui.h"
+
+// Chrome sync options page UI handler.
+class SyncOptionsHandler : public OptionsPageUIHandler {
+ public:
+ SyncOptionsHandler();
+ virtual ~SyncOptionsHandler();
+
+ // OptionsUIHandler implementation.
+ virtual void GetLocalizedValues(DictionaryValue* localized_strings);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SyncOptionsHandler);
+};
+
+#endif // CHROME_BROWSER_DOM_UI_SYNC_OPTIONS_HANDLER_H_