diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/autofill_profiles_view_win.cc | 26 | ||||
-rw-r--r-- | chrome/browser/views/list_background.h | 36 | ||||
-rw-r--r-- | chrome/browser/views/options/advanced_contents_view.cc | 24 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 1 |
4 files changed, 39 insertions, 48 deletions
diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc index aa83b48..5951b49 100644 --- a/chrome/browser/views/autofill_profiles_view_win.cc +++ b/chrome/browser/views/autofill_profiles_view_win.cc @@ -15,6 +15,7 @@ #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/browser/theme_resources_util.h" +#include "chrome/browser/views/list_background.h" #include "chrome/browser/window_sizer.h" #include "chrome/common/pref_names.h" #include "gfx/canvas.h" @@ -42,31 +43,6 @@ const int kDialogPadding = 7; // Insets for subview controls. const int kSubViewInsets = 5; -// TODO(georgey) remove this code into a separate file as it is already the same -// elsewhere. -// A background object that paints the scrollable list background, -// which may be rendered by the system visual styles system. -class ListBackground : public views::Background { - public: - explicit ListBackground() { - SkColor list_color = - gfx::NativeTheme::instance()->GetThemeColorWithDefault( - gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW); - SetNativeControlColor(list_color); - } - virtual ~ListBackground() {} - - virtual void Paint(gfx::Canvas* canvas, views::View* view) const { - HDC dc = canvas->beginPlatformPaint(); - RECT native_lb = view->GetLocalBounds(true).ToRECT(); - gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); - canvas->endPlatformPaint(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(ListBackground); -}; - }; // namespace ///////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/list_background.h b/chrome/browser/views/list_background.h new file mode 100644 index 0000000..ba8317a --- /dev/null +++ b/chrome/browser/views/list_background.h @@ -0,0 +1,36 @@ +// 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_VIEWS_LIST_BACKGROUND_H_ +#define CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_ + +#include "gfx/canvas.h" +#include "gfx/native_theme_win.h" +#include "views/background.h" + +// A background object that paints the scrollable list background, +// which may be rendered by the system visual styles system. +class ListBackground : public views::Background { + public: + explicit ListBackground() { + SkColor list_color = + gfx::NativeTheme::instance()->GetThemeColorWithDefault( + gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW); + SetNativeControlColor(list_color); + } + virtual ~ListBackground() {} + + virtual void Paint(gfx::Canvas* canvas, views::View* view) const { + HDC dc = canvas->beginPlatformPaint(); + RECT native_lb = view->GetLocalBounds(true).ToRECT(); + gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); + canvas->endPlatformPaint(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(ListBackground); +}; + +#endif // CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_ + diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 4594165..489248c 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -35,6 +35,7 @@ #include "chrome/browser/shell_dialogs.h" #include "chrome/browser/views/browser_dialogs.h" #include "chrome/browser/views/clear_browsing_data.h" +#include "chrome/browser/views/list_background.h" #include "chrome/browser/views/options/content_settings_window_view.h" #include "chrome/browser/views/options/fonts_languages_window_view.h" #include "chrome/browser/views/restart_message_box.h" @@ -72,29 +73,6 @@ const int kFileIconTextFieldSpacing = 3; namespace { -// A background object that paints the scrollable list background, -// which may be rendered by the system visual styles system. -class ListBackground : public views::Background { - public: - explicit ListBackground() { - SkColor list_color = - gfx::NativeTheme::instance()->GetThemeColorWithDefault( - gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW); - SetNativeControlColor(list_color); - } - virtual ~ListBackground() {} - - virtual void Paint(gfx::Canvas* canvas, views::View* view) const { - HDC dc = canvas->beginPlatformPaint(); - RECT native_lb = view->GetLocalBounds(true).ToRECT(); - gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); - canvas->endPlatformPaint(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(ListBackground); -}; - //////////////////////////////////////////////////////////////////////////////// // FileDisplayArea diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 6ebaa57..bde7bd5 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1527,6 +1527,7 @@ 'browser/language_combobox_model.h', 'browser/language_order_table_model.cc', 'browser/language_order_table_model.h', + 'browser/list_background.h', 'browser/load_from_memory_cache_details.h', 'browser/load_notification_details.h', 'browser/location_bar.h', |