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

Unified Diff: views/native_theme_painter.cc

Issue 8771006: views: Move the remaining file from views/ to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « views/native_theme_painter.h ('k') | views/paint_lock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/native_theme_painter.cc
diff --git a/views/native_theme_painter.cc b/views/native_theme_painter.cc
deleted file mode 100644
index 584667b92077d5d7fee2ca91a4b15d4c3511452a..0000000000000000000000000000000000000000
--- a/views/native_theme_painter.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "views/native_theme_painter.h"
-
-#include "base/logging.h"
-#include "ui/base/animation/animation.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/canvas_skia.h"
-#include "ui/gfx/rect.h"
-#include "views/native_theme_delegate.h"
-
-namespace views {
-
-NativeThemePainter::NativeThemePainter(NativeThemeDelegate* delegate)
- : delegate_(delegate) {
- DCHECK(delegate_);
-}
-
-gfx::Size NativeThemePainter::GetPreferredSize() {
- const gfx::NativeTheme* theme = gfx::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
- return theme->GetPartSize(delegate_->GetThemePart(), state, extra);
-}
-
-void NativeThemePainter::Paint(int w, int h, gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
- gfx::NativeTheme::Part part = delegate_->GetThemePart();
- gfx::Rect rect(0, 0, w, h);
-
- if (delegate_->GetThemeAnimation() != NULL &&
- delegate_->GetThemeAnimation()->is_animating()) {
- // Paint background state.
- gfx::NativeTheme::ExtraParams prev_extra;
- gfx::NativeTheme::State prev_state =
- delegate_->GetBackgroundThemeState(&prev_extra);
- native_theme->Paint(
- canvas->GetSkCanvas(), part, prev_state, rect, prev_extra);
-
- // Composite foreground state above it.
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
- int alpha = delegate_->GetThemeAnimation()->CurrentValueBetween(0, 255);
- canvas->SaveLayerAlpha(static_cast<uint8>(alpha));
- native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra);
- canvas->Restore();
- } else {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
- native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra);
- }
-}
-
-} // namespace views
« no previous file with comments | « views/native_theme_painter.h ('k') | views/paint_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698