summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/options/content_page_view.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
commit4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f (patch)
tree69a1e9f78b3a5fa8b909cfab336826b09c44235f /chrome/browser/views/options/content_page_view.cc
parent5085ee0b4bfbe4625e63ee6975bb95702e13e0aa (diff)
downloadchromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.zip
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.gz
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.bz2
This is the first pass at themes.
This CL is paired with http://codereview.chromium.org/67284 This CL (for commit purposes) includes http://codereview.chromium.org/67284 BUG=4463,11232,11233,11234,11235 Review URL: http://codereview.chromium.org/99030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options/content_page_view.cc')
-rw-r--r--chrome/browser/views/options/content_page_view.cc75
1 files changed, 57 insertions, 18 deletions
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc
index 6e3aff2..badd2f6 100644
--- a/chrome/browser/views/options/content_page_view.cc
+++ b/chrome/browser/views/options/content_page_view.cc
@@ -12,6 +12,7 @@
#include "app/gfx/chrome_canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/gfx/native_theme.h"
#include "chrome/browser/browser_process.h"
@@ -19,6 +20,7 @@
#include "chrome/browser/views/options/fonts_languages_window_view.h"
#include "chrome/browser/views/options/options_group_view.h"
#include "chrome/browser/views/options/passwords_exceptions_window_view.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "grit/generated_resources.h"
@@ -181,6 +183,8 @@ ContentPageView::ContentPageView(Profile* profile)
passwords_neversave_radio_(NULL),
fonts_lang_group_(NULL),
fonts_and_languages_label_(NULL),
+ themes_group_(NULL),
+ themes_reset_button_(NULL),
change_content_fonts_button_(NULL),
OptionsPageView(profile) {
}
@@ -257,6 +261,9 @@ void ContentPageView::ButtonPressed(views::Button* sender) {
GetRootWindow(),
gfx::Rect(),
new FontsLanguagesWindowView(profile()))->Show();
+ } else if (sender == themes_reset_button_) {
+ UserMetricsRecordAction(L"Options_ThemesReset", profile()->GetPrefs());
+ profile()->ClearTheme();
}
}
@@ -299,6 +306,14 @@ void ContentPageView::InitControlLayout() {
layout->AddView(form_autofill_group_);
layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kEnableExtensions)) {
+ layout->StartRow(0, single_column_view_set_id);
+ InitThemesGroup();
+ layout->AddView(themes_group_);
+ layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
+ }
+
// Init member prefs so we can update the controls if prefs change.
default_download_location_.Init(prefs::kDownloadDefaultDirectory,
profile()->GetPrefs(), this);
@@ -445,6 +460,39 @@ void ContentPageView::InitPasswordSavingGroup() {
true);
}
+void ContentPageView::InitFontsLangGroup() {
+ fonts_and_languages_label_ = new views::Label(
+ l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_INFO));
+ fonts_and_languages_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
+ fonts_and_languages_label_->SetMultiLine(true);
+ change_content_fonts_button_ = new views::NativeButton(
+ this,
+ l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTS_BUTTON));
+
+ using views::GridLayout;
+ using views::ColumnSet;
+
+ views::View* contents = new views::View;
+ GridLayout* layout = new GridLayout(contents);
+ contents->SetLayoutManager(layout);
+
+ const int single_column_view_set_id = 1;
+ ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id);
+ column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 1,
+ GridLayout::USE_PREF, 0, 0);
+
+ layout->StartRow(0, single_column_view_set_id);
+ layout->AddView(fonts_and_languages_label_);
+ layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
+ layout->StartRow(0, single_column_view_set_id);
+ layout->AddView(change_content_fonts_button_);
+
+ fonts_lang_group_ = new OptionsGroupView(
+ contents,
+ l10n_util::GetString(IDS_OPTIONS_FONTSANDLANGUAGES_GROUP_NAME),
+ L"", true);
+}
+
void ContentPageView::InitFormAutofillGroup() {
form_autofill_checkbox_ = new views::Checkbox(
l10n_util::GetString(IDS_AUTOFILL_SAVEFORMS));
@@ -468,17 +516,12 @@ void ContentPageView::InitFormAutofillGroup() {
form_autofill_group_ = new OptionsGroupView(
contents, l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME),
- L"", false);
+ L"", true);
}
-void ContentPageView::InitFontsLangGroup() {
- fonts_and_languages_label_ = new views::Label(
- l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_INFO));
- fonts_and_languages_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
- fonts_and_languages_label_->SetMultiLine(true);
- change_content_fonts_button_ = new views::NativeButton(
- this,
- l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTS_BUTTON));
+void ContentPageView::InitThemesGroup() {
+ themes_reset_button_ = new views::NativeButton(this,
+ l10n_util::GetString(IDS_THEMES_RESET_BUTTON));
using views::GridLayout;
using views::ColumnSet;
@@ -490,18 +533,14 @@ void ContentPageView::InitFontsLangGroup() {
const int single_column_view_set_id = 1;
ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id);
column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 1,
- GridLayout::USE_PREF, 0, 0);
+ GridLayout::USE_PREF, 0, 0);
layout->StartRow(0, single_column_view_set_id);
- layout->AddView(fonts_and_languages_label_);
- layout->AddPaddingRow(0, kRelatedControlVerticalSpacing);
- layout->StartRow(0, single_column_view_set_id);
- layout->AddView(change_content_fonts_button_);
+ layout->AddView(themes_reset_button_);
- fonts_lang_group_ = new OptionsGroupView(
- contents,
- l10n_util::GetString(IDS_OPTIONS_FONTSANDLANGUAGES_GROUP_NAME),
- L"", true);
+ themes_group_ = new OptionsGroupView(
+ contents, l10n_util::GetString(IDS_THEMES_GROUP_NAME),
+ L"", false);
}
void ContentPageView::UpdateDownloadDirectoryDisplay() {