Skip to content
Snippets Groups Projects
Commit f8d01a8f authored by jhawkins@chromium.org's avatar jhawkins@chromium.org
Browse files

DOMUI: Turn the google dashboard link into a real link and fix the behavior of

the 'Get Themes' link.

BUG=62887
TEST=none

Review URL: http://codereview.chromium.org/4821003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66166 0039d316-1c4b-4281-b951-d872f2087c98
parent 0b18321c
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,11 @@ void PersonalOptionsHandler::GetLocalizedValues( ...@@ -89,6 +89,11 @@ void PersonalOptionsHandler::GetLocalizedValues(
localized_strings->SetString("import_data", localized_strings->SetString("import_data",
l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON)); l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON));
localized_strings->SetString("themes_gallery",
l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
localized_strings->SetString("themes_gallery_url",
l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_URL));
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
localized_strings->SetString("appearance", localized_strings->SetString("appearance",
l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME)); l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME));
...@@ -100,15 +105,11 @@ void PersonalOptionsHandler::GetLocalizedValues( ...@@ -100,15 +105,11 @@ void PersonalOptionsHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO));
localized_strings->SetString("hideWindow_decorations_radio", localized_strings->SetString("hideWindow_decorations_radio",
l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO));
localized_strings->SetString("themes_gallery",
l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
#else #else
localized_strings->SetString("themes", localized_strings->SetString("themes",
l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)); l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME));
localized_strings->SetString("themes_reset", localized_strings->SetString("themes_reset",
l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON)); l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON));
localized_strings->SetString("themes_gallery",
l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
localized_strings->SetString("themes_default", localized_strings->SetString("themes_default",
l10n_util::GetStringUTF16(IDS_THEMES_DEFAULT_THEME_LABEL)); l10n_util::GetStringUTF16(IDS_THEMES_DEFAULT_THEME_LABEL));
#endif #endif
...@@ -119,16 +120,9 @@ void PersonalOptionsHandler::RegisterMessages() { ...@@ -119,16 +120,9 @@ void PersonalOptionsHandler::RegisterMessages() {
dom_ui_->RegisterMessageCallback( dom_ui_->RegisterMessageCallback(
"showSyncLoginDialog", "showSyncLoginDialog",
NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog)); NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog));
dom_ui_->RegisterMessageCallback(
"openPrivacyDashboardTabAndActivate",
NewCallback(this,
&PersonalOptionsHandler::OpenPrivacyDashboardTabAndActivate));
dom_ui_->RegisterMessageCallback( dom_ui_->RegisterMessageCallback(
"themesReset", "themesReset",
NewCallback(this, &PersonalOptionsHandler::ThemesReset)); NewCallback(this, &PersonalOptionsHandler::ThemesReset));
dom_ui_->RegisterMessageCallback(
"themesGallery",
NewCallback(this, &PersonalOptionsHandler::ThemesGallery));
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
dom_ui_->RegisterMessageCallback( dom_ui_->RegisterMessageCallback(
"themesSetGTK", "themesSetGTK",
...@@ -279,21 +273,11 @@ void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { ...@@ -279,21 +273,11 @@ void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
} }
void PersonalOptionsHandler::OpenPrivacyDashboardTabAndActivate(
const ListValue* args) {
BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate();
}
void PersonalOptionsHandler::ThemesReset(const ListValue* args) { void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"));
dom_ui_->GetProfile()->ClearTheme(); dom_ui_->GetProfile()->ClearTheme();
} }
void PersonalOptionsHandler::ThemesGallery(const ListValue* args) {
UserMetricsRecordAction(UserMetricsAction("Options_ThemesGallery"));
BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate();
}
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"));
......
...@@ -36,9 +36,7 @@ class PersonalOptionsHandler : public OptionsPageUIHandler, ...@@ -36,9 +36,7 @@ class PersonalOptionsHandler : public OptionsPageUIHandler,
private: private:
void ObserveThemeChanged(); void ObserveThemeChanged();
void ShowSyncLoginDialog(const ListValue* args); void ShowSyncLoginDialog(const ListValue* args);
void OpenPrivacyDashboardTabAndActivate(const ListValue* args);
void ThemesReset(const ListValue* args); void ThemesReset(const ListValue* args);
void ThemesGallery(const ListValue* args);
#if defined(TOOLKIT_GTK) #if defined(TOOLKIT_GTK)
void ThemesSetGTK(const ListValue* args); void ThemesSetGTK(const ListValue* args);
#endif #endif
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<button id="start-stop-sync"></button> <button id="start-stop-sync"></button>
<button id="customize-sync""></button> <button id="customize-sync""></button>
</div> </div>
<button id="privacy-dashboard-link" class="link-button" <a href="https://www.google.com/dashboard" id="privacy-dashboard-link"
i18n-content="privacy_dashboard_link"></button> i18n-content="privacy_dashboard_link" target="_blank"></a>
</div> </div>
</section> </section>
<section> <section>
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
i18n-content="themes_GTK_button"></button> i18n-content="themes_GTK_button"></button>
<button id="themes_set_classic" <button id="themes_set_classic"
i18n-content="themes_set_classic"></button> i18n-content="themes_set_classic"></button>
<a i18n-content="themes_gallery" id="themes-gallery" href="#"></a> <a id="themes-gallery" i18n-content="themes_gallery"
i18n-values="href:themes_gallery_url" target="_blank"></a>
</div> </div>
<label class="radio"> <label class="radio">
<input name="decorations_radio" <input name="decorations_radio"
...@@ -96,7 +97,8 @@ ...@@ -96,7 +97,8 @@
<h3 i18n-content="themes"></h3> <h3 i18n-content="themes"></h3>
<div> <div>
<button id="themes_reset" i18n-content="themes_reset"></button> <button id="themes_reset" i18n-content="themes_reset"></button>
<a i18n-content="themes_gallery" id="themes-gallery" href="#"></a> <a id="themes-gallery" i18n-content="themes_gallery"
i18n-values="href:themes_gallery_url" target="_blank"></a>
</div> </div>
</section> </section>
</if> </if>
......
...@@ -73,18 +73,12 @@ cr.define('options', function() { ...@@ -73,18 +73,12 @@ cr.define('options', function() {
$('themes_set_classic').onclick = function(event) { $('themes_set_classic').onclick = function(event) {
chrome.send('themesReset'); chrome.send('themesReset');
}; };
$('themes-gallery').onclick = function(event) {
chrome.send('themesGallery');
}
} }
if (cr.isMac || cr.isWindows || cr.isChromeOS) { if (cr.isMac || cr.isWindows || cr.isChromeOS) {
$('themes_reset').onclick = function(event) { $('themes_reset').onclick = function(event) {
chrome.send('themesReset'); chrome.send('themesReset');
}; };
$('themes-gallery').onclick = function(event) {
chrome.send('themesGallery');
}
} }
if (cr.isChromeOS) { if (cr.isChromeOS) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment