Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: ui/views/background.cc

Issue 2835233005: Revert of Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/background.h ('k') | ui/views/bubble/tray_bubble_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/background.cc
diff --git a/ui/views/background.cc b/ui/views/background.cc
index e036490a0c24950c931077dd106f41cbbad5b055..190a5a62c346e714f9b7c4dad8a8d79321132a0d 100644
--- a/ui/views/background.cc
+++ b/ui/views/background.cc
@@ -6,14 +6,11 @@
#include "base/logging.h"
#include "base/macros.h"
-#include "base/scoped_observer.h"
#include "build/build_config.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/views/painter.h"
#include "ui/views/view.h"
-#include "ui/views/view_observer.h"
#if defined(OS_WIN)
#include "skia/ext/skia_utils_win.h"
@@ -37,32 +34,6 @@
private:
DISALLOW_COPY_AND_ASSIGN(SolidBackground);
-};
-
-// ThemedSolidBackground is a solid background that stays in sync with a view's
-// native theme.
-class ThemedSolidBackground : public SolidBackground, public ViewObserver {
- public:
- explicit ThemedSolidBackground(View* view, ui::NativeTheme::ColorId color_id)
- : SolidBackground(gfx::kPlaceholderColor),
- observer_(this),
- color_id_(color_id) {
- observer_.Add(view);
- OnViewNativeThemeChanged(view);
- }
- ~ThemedSolidBackground() override {}
-
- // ViewObserver:
- void OnViewNativeThemeChanged(View* view) override {
- SetNativeControlColor(view->GetNativeTheme()->GetSystemColor(color_id_));
- view->SchedulePaint();
- }
-
- private:
- ScopedObserver<View, ViewObserver> observer_;
- ui::NativeTheme::ColorId color_id_;
-
- DISALLOW_COPY_AND_ASSIGN(ThemedSolidBackground);
};
class BackgroundPainter : public Background {
@@ -102,13 +73,6 @@
}
// static
-Background* Background::CreateThemedSolidBackground(
- View* view,
- ui::NativeTheme::ColorId color_id) {
- return new ThemedSolidBackground(view, color_id);
-}
-
-// static
Background* Background::CreateStandardPanelBackground() {
// TODO(beng): Should be in NativeTheme.
return CreateSolidBackground(SK_ColorWHITE);
« no previous file with comments | « ui/views/background.h ('k') | ui/views/bubble/tray_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698