summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 06:10:39 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 06:10:39 +0000
commitb83efaa3396231ccfd2d414a018c550f91988431 (patch)
tree4fa08296c264cc5516409f1bb5b4d35f845555c3
parent6a6650bff58d91820f4bf6459578e639da7d3065 (diff)
downloadchromium_src-b83efaa3396231ccfd2d414a018c550f91988431.zip
chromium_src-b83efaa3396231ccfd2d414a018c550f91988431.tar.gz
chromium_src-b83efaa3396231ccfd2d414a018c550f91988431.tar.bz2
Revert 52787 - Make the personal stuff page viewable.
BUG=48883 TEST=Exercise Personal Stuff page via --enabled-tabbed-options Review URL: http://codereview.chromium.org/2819046 TBR=sargrass@google.com Review URL: http://codereview.chromium.org/3012007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52810 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/dom_ui/sync_options_handler.cc (renamed from chrome/browser/dom_ui/sync_options_handler.cc)2
-rw-r--r--chrome/browser/chromeos/dom_ui/sync_options_handler.h (renamed from chrome/browser/dom_ui/sync_options_handler.h)8
-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/resources/options.html4
-rw-r--r--chrome/browser/resources/options/personal_options.css6
-rw-r--r--chrome/browser/resources/options/personal_options.html143
-rw-r--r--chrome/browser/resources/options/personal_options.js49
-rw-r--r--chrome/browser/resources/options/pref_ui.js52
-rw-r--r--chrome/chrome_browser.gypi4
10 files changed, 35 insertions, 329 deletions
diff --git a/chrome/browser/dom_ui/sync_options_handler.cc b/chrome/browser/chromeos/dom_ui/sync_options_handler.cc
index 8378a13..073b8d4f 100644
--- a/chrome/browser/dom_ui/sync_options_handler.cc
+++ b/chrome/browser/chromeos/dom_ui/sync_options_handler.cc
@@ -2,7 +2,7 @@
// 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 "chrome/browser/chromeos/dom_ui/sync_options_handler.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
diff --git a/chrome/browser/dom_ui/sync_options_handler.h b/chrome/browser/chromeos/dom_ui/sync_options_handler.h
index 8c7923c..a58c583 100644
--- a/chrome/browser/dom_ui/sync_options_handler.h
+++ b/chrome/browser/chromeos/dom_ui/sync_options_handler.h
@@ -2,12 +2,12 @@
// 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_
+#ifndef CHROME_BROWSER_CHROMEOS_DOM_UI_SYNC_OPTIONS_HANDLER_H_
+#define CHROME_BROWSER_CHROMEOS_DOM_UI_SYNC_OPTIONS_HANDLER_H_
#include "chrome/browser/dom_ui/options_ui.h"
-// Chrome sync options page UI handler.
+// ChromeOS system options page UI handler.
class SyncOptionsHandler : public OptionsPageUIHandler {
public:
SyncOptionsHandler();
@@ -20,4 +20,4 @@ class SyncOptionsHandler : public OptionsPageUIHandler {
DISALLOW_COPY_AND_ASSIGN(SyncOptionsHandler);
};
-#endif // CHROME_BROWSER_DOM_UI_SYNC_OPTIONS_HANDLER_H_
+#endif // CHROME_BROWSER_CHROMEOS_DOM_UI_SYNC_OPTIONS_HANDLER_H_
diff --git a/chrome/browser/dom_ui/options_ui.cc b/chrome/browser/dom_ui/options_ui.cc
index 77b87a1..5fc50dc 100644
--- a/chrome/browser/dom_ui/options_ui.cc
+++ b/chrome/browser/dom_ui/options_ui.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/dom_ui/content_settings_handler.h"
#include "chrome/browser/dom_ui/core_options_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"
@@ -117,11 +116,10 @@ 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());
@@ -129,6 +127,7 @@ OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) {
AddOptionsPageUIHandler(localized_strings,
new chromeos::AccountsOptionsHandler());
#endif
+ AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler());
// |localized_strings| ownership is taken over by this constructor.
OptionsUIHTMLSource* html_source =
diff --git a/chrome/browser/dom_ui/personal_options_handler.cc b/chrome/browser/dom_ui/personal_options_handler.cc
index 1db6a8a..c0f13b8 100644
--- a/chrome/browser/dom_ui/personal_options_handler.cc
+++ b/chrome/browser/dom_ui/personal_options_handler.cc
@@ -5,24 +5,10 @@
#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() {
}
@@ -32,74 +18,43 @@ 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);
- //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",
+ localized_strings->SetString(L"passwordsGroupName",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_GROUP_NAME));
- localized_strings->SetString(L"passwords_asktosave",
+ localized_strings->SetString(L"passwordsAskToSave",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE));
- localized_strings->SetString(L"passwords_neversave",
+ localized_strings->SetString(L"passwordsNeverSave",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE));
- localized_strings->SetString(L"showpasswords",
+ localized_strings->SetString(L"passwordShowPasswords",
l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS));
-
- localized_strings->SetString(L"autofill",
+ localized_strings->SetString(L"autoFillSettingWindowsGroupName",
l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME));
- localized_strings->SetString(L"autofill_enable",
+ localized_strings->SetString(L"autoFillEnable",
l10n_util::GetString(IDS_OPTIONS_AUTOFILL_ENABLE));
- localized_strings->SetString(L"autofill_disable",
+ localized_strings->SetString(L"autoFillDisable",
l10n_util::GetString(IDS_OPTIONS_AUTOFILL_DISABLE));
- 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));
-
+ localized_strings->SetString(L"themesGroupName",
+ l10n_util::GetString(IDS_THEMES_GROUP_NAME));
#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
- localized_strings->SetString(L"appearance",
+ localized_strings->SetString(L"appearanceGroupName",
l10n_util::GetString(IDS_APPEARANCE_GROUP_NAME));
- localized_strings->SetString(L"themes_GTK_button",
+ localized_strings->SetString(L"themesGTKButton",
l10n_util::GetString(IDS_THEMES_GTK_BUTTON));
- localized_strings->SetString(L"themes_set_classic",
+ localized_strings->SetString(L"themesSetClassic",
l10n_util::GetString(IDS_THEMES_SET_CLASSIC));
- localized_strings->SetString(L"showWindow_decorations_radio",
+ localized_strings->SetString(L"showWindowDecorationsRadio",
l10n_util::GetString(IDS_SHOW_WINDOW_DECORATIONS_RADIO));
- localized_strings->SetString(L"hideWindow_decorations_radio",
+ localized_strings->SetString(L"hideWindowDecorationsRadio",
l10n_util::GetString(IDS_HIDE_WINDOW_DECORATIONS_RADIO));
- 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",
+#endif
+ localized_strings->SetString(L"themesResetButton",
l10n_util::GetString(IDS_THEMES_RESET_BUTTON));
- localized_strings->SetString(L"themes_gallery",
- l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON));
- localized_strings->SetString(L"themes_default",
+ localized_strings->SetString(L"themesDefaultThemeLabel",
l10n_util::GetString(IDS_THEMES_DEFAULT_THEME_LABEL));
-#endif
+ localized_strings->SetString(L"themesGalleryButton",
+ 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));
}
diff --git a/chrome/browser/resources/options.html b/chrome/browser/resources/options.html
index c478bde..fcf3b5f 100644
--- a/chrome/browser/resources/options.html
+++ b/chrome/browser/resources/options.html
@@ -99,7 +99,6 @@ window.onpopstate = function(e) {
<if expr="pp_ifdef('chromeos')">
<link rel="stylesheet" href="options/chromeos_accounts_options_page.css">
</if>
-<link rel="stylesheet" href="options/personal_options.css">
</head>
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
<div class="header">
@@ -136,16 +135,15 @@ window.onpopstate = function(e) {
</if>
<include src="options/browser_options.html">
<include src="options/personal_options.html">
- <include src="options/sync_options.html">
<include src="options/advanced_options.html">
<include src="options/content_settings.html">
+ <include src="options/sync_options.html">
</div>
</div>
<script>
// Decorate the existing elements in the document.
cr.ui.decorate('input[pref][type=checkbox]', PrefCheckbox);
-cr.ui.decorate('input[pref][type=radio]', PrefRadio);
cr.ui.decorate('input[pref][type=range]', PrefRange);
cr.ui.decorate('select[pref]', PrefSelect);
cr.ui.decorate('#contentSettingsPage input[type=radio]', ContentSettingsRadio);
diff --git a/chrome/browser/resources/options/personal_options.css b/chrome/browser/resources/options/personal_options.css
deleted file mode 100644
index 414e0ed..0000000
--- a/chrome/browser/resources/options/personal_options.css
+++ /dev/null
@@ -1,6 +0,0 @@
-#text-when-synced, #button-when-synced {
- display: none;
-}
-#text-when-not-synced, #button-when-not-synced {
- display: none;
-}
diff --git a/chrome/browser/resources/options/personal_options.html b/chrome/browser/resources/options/personal_options.html
index b35ce94..ffdc855 100644
--- a/chrome/browser/resources/options/personal_options.html
+++ b/chrome/browser/resources/options/personal_options.html
@@ -1,146 +1,3 @@
<div class="page hidden" id="personalPage">
<h1 i18n-content="personalPage"></h1>
-
- <section>
- <h3 i18n-content="sync_section"></h3>
- <table class="option-control-table">
- <tr id="text-when-not-synced">
- <td>
- <div class="section-text" id="sync_not_setup_info"
- i18n-content="sync_not_setup_info"/>
- </td>
- </tr>
- <tr id="button-when-not-synced">
- <td>
- <button id="start-sync" i18n-content="start_sync"></button>
- </td>
- </tr>
- </div>
- <div>
- <tr id="text-when-synced">
- <td>
- <div class="section-text" id="synced_to_user_with_time"
- i18n-content="synced_to_user_with_time"/>
- </td>
- </tr>
- <tr id="button-when-synced">
- <td>
- <button id="stop-sync" i18n-content="stop_sync"></button>
- <button id="sync-customize" i18n-content="sync_customize"></button>
- </td>
- </tr>
- </div>
- </table>
- </section>
- <section>
- <h3 i18n-content="passwords"></h3>
- <table class="option-control-table">
- <tr>
- <td class="option-name">
- <label>
- <input id="passwords_asktosave"
- name="passwords_radio"
- pref="profile.password_manager_enabled"
- type="radio" value="true">
- <span i18n-content="passwords_asktosave"></span>
- </label>
- </tr>
- <tr>
- <td class="option-name">
- <label>
- <input id="passwords_neversave"
- name="passwords_radio"
- pref="profile.password_manager_enabled"
- type="radio" value="false">
- <span i18n-content="passwords_neversave"></span>
- </label>
- </tr>
- <tr>
- <button id="showpasswords" i18n-content="showpasswords"></button>
- </tr>
- </table>
- </section>
- <section>
- <h3 i18n-content="autofill"></h3>
- <table class="option-control-table">
- <tr>
- <td class="option-name">
- <label>
- <input id="autofill_enable"
- name="autofill_radio"
- pref="autofill.enabled"
- type="radio" value="true">
- <span i18n-content="autofill_enable"></span>
- </label>
- </tr>
- <tr>
- <td class="option-name">
- <label>
- <input id="autofill_disable"
- name="autofill_radio"
- pref="autofill.enabled"
- type="radio" value="false">
- <span i18n-content="autofill_disable"></span>
- </label>
- </tr>
- <tr>
- <button id="autofill_options" i18n-content="autofill_options">
- </button>
- </tr>
- </table>
- </section>
- <section>
- <h3 i18n-content="browsing_data"></h3>
- <table class="option-control-table">
- <tr>
- <button id="import_data" i18n-content="import_data"></button>
- </tr>
- </table>
- </section>
-
- <if expr="os == 'linux2' or os.find('bsd') != -1">
- <if expr="not pp_ifdef('chromeos')">
- <section>
- <h3 i18n-content="appearance"></h3>
- <table class="option-control-table">
- <tr>
- <button id="themes_GTK_button" i18n-content="themes_GTK_button">
- </button>
- <button id="themes_set_classic" i18n-content="themes_set_classic">
- </button>
- <a id="linux_themes_gallery" i18n-content="themes_gallery"></a>
- </tr>
- <tr>
- <td class="option-name">
- <label>
- <input name="decorations_radio"
- pref="browser.custom_chrome_frame"
- type="radio" value="false">
- <span i18n-content="showWindow_decorations_radio"></span>
- </label>
- </tr>
- <tr>
- <td class="option-name">
- <label>
- <input name="decorations_radio"
- pref="browser.custom_chrome_frame"
- type="radio" value="true">
- <span i18n-content="hideWindow_decorations_radio"></span>
- </label>
- </tr>
- </table>
- </section>
- </if></if>
- <if expr="pp_ifdef('chromeos') or os == 'win32' or os == 'darwin'">
- <section>
- <h3 i18n-content="themes"></h3>
- <table class="option-control-table">
- <tr>
- <button id="themes_reset" i18n-content="themes_reset"></button>
- <a id="nonlinux_themes_gallery" i18n-content="themes_gallery"></a>
- </tr>
- </table>
- </section>
- </if>
-
</div>
diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js
index d22c4da..b7b48c9 100644
--- a/chrome/browser/resources/options/personal_options.js
+++ b/chrome/browser/resources/options/personal_options.js
@@ -21,51 +21,6 @@ PersonalOptions.prototype = {
// Call base class implementation to starts preference initialization.
OptionsPage.prototype.initializePage.call(this);
-
- // Listen to pref changes.
- Preferences.getInstance().addEventListener('sync.has_setup_completed',
- function(event) {
- if(event.value){
- $('text-when-synced').style.display = 'block';
- $('button-when-synced').style.display = 'block';
- }
- else{
- $('text-when-not-synced').style.display = 'block';
- $('button-when-not-synced').style.display = 'block';
- }
- });
-
- $('sync-customize').onclick = function(event){
- OptionsPage.showPageByName('sync');
- };
-
- $('showpasswords').onclick = function(event){
- //TODO(sargrass): Show passwords dialog here.
- };
-
- $('autofill_options').onclick = function(event){
- //TODO(sargrass): Show autofill dialog here.
- };
-
- $('import_data').onclick = function(event){
- //TODO(sargrass): Show import_data dialog here.
- };
-
- if(navigator.platform.match(/linux|BSD/i)){
- $('themes_GTK_button').onclick = function(event){
- //TODO(sargrass): Show themes GTK dialog here.
- };
-
- $('themes_set_classic').onclick = function(event){
- //TODO(sargrass): Show themes set classic dialog here.
- };
- }
-
- if(navigator.platform.match(/Mac|Win|CrOS/i)){
- $('themes_reset').onclick = function(event){
- //TODO(sargrass): Show themes reset dialog here.
- };
- }
-
- },
+ // TODO(csilv): add any needed initialization here or delete this method.
+ }
};
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index 4522ab5..3cf6f49 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -41,58 +41,6 @@ PrefCheckbox.prototype = {
cr.defineProperty(PrefCheckbox, 'pref', cr.PropertyKind.ATTR);
///////////////////////////////////////////////////////////////////////////////
-// PrefRadio class:
-
-// Define a constructor that uses an input element as its underlying element.
-var PrefRadio = cr.ui.define('input');
-
-PrefRadio.prototype = {
- // Set up the prototype chain
- __proto__: HTMLInputElement.prototype,
-
- /**
- * Initialization function for the cr.ui framework.
- */
- decorate: function() {
- this.type = 'radio';
- var self = this;
-
- // Listen to pref changes.
- Preferences.getInstance().addEventListener(this.pref,
- function(event) {
- self.checked = String(event.value) == self.value;
- });
-
- // Listen to user events.
- this.addEventListener('change',
- function(e) {
- if(self.value == 'true' || self.value == 'false') {
- Preferences.setBooleanPref(self.pref,
- self.value == 'true');
- }else {
- Preferences.setIntegerPref(self.pref,
- parseInt(self.value, 10));
- }
- });
- },
-
- /**
- * Getter for preference name attribute.
- */
- get pref() {
- return this.getAttribute('pref');
- },
-
- /**
- * Setter for preference name attribute.
- */
- set pref(name) {
- this.setAttribute('pref', name);
- }
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
// PrefRange class:
// Define a constructor that uses an input element as its underlying element.
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 5939339..0bf2847 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -403,6 +403,8 @@
'browser/chromeos/dom_ui/language_hangul_options_handler.h',
'browser/chromeos/dom_ui/language_options_handler.cc',
'browser/chromeos/dom_ui/language_options_handler.h',
+ 'browser/chromeos/dom_ui/sync_options_handler.cc',
+ 'browser/chromeos/dom_ui/sync_options_handler.h',
'browser/chromeos/dom_ui/system_options_handler.cc',
'browser/chromeos/dom_ui/system_options_handler.h',
'browser/chromeos/drop_shadow_label.cc',
@@ -1075,8 +1077,6 @@
'browser/dom_ui/core_options_handler.h',
'browser/dom_ui/personal_options_handler.cc',
'browser/dom_ui/personal_options_handler.h',
- 'browser/dom_ui/sync_options_handler.cc',
- 'browser/dom_ui/sync_options_handler.h',
'browser/dom_ui/devtools_ui.cc',
'browser/dom_ui/devtools_ui.h',
'browser/dom_ui/dom_ui.cc',