summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/scrollbar
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-15 02:07:52 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-15 02:07:52 +0000
commitf78452fc691fd36f44b13fa1443a6c002183cb58 (patch)
tree5ad6999431d2ac3ff0879394eaf4f7faf09a9c33 /ui/views/controls/scrollbar
parent2534b2d81a438cbbcfce12853bb43e837dfe8b1b (diff)
downloadchromium_src-f78452fc691fd36f44b13fa1443a6c002183cb58.zip
chromium_src-f78452fc691fd36f44b13fa1443a6c002183cb58.tar.gz
chromium_src-f78452fc691fd36f44b13fa1443a6c002183cb58.tar.bz2
ui: Move NativeTheme files into ui/base/native_theme/ directory.
BUG=103304,125844 R=ben@chromium.org TBR=tony@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=136996 Review URL: https://chromiumcodereview.appspot.com/10310136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/scrollbar')
-rw-r--r--ui/views/controls/scrollbar/native_scroll_bar_views.cc106
-rw-r--r--ui/views/controls/scrollbar/native_scroll_bar_views.h10
2 files changed, 58 insertions, 58 deletions
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.cc b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
index 7eb2a08..72f47c3 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
@@ -41,9 +41,9 @@ class ScrollBarButton : public BaseScrollBarButton {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
private:
- gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
- gfx::NativeTheme::Part GetNativeThemePart() const;
- gfx::NativeTheme::State GetNativeThemeState() const;
+ ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ ui::NativeTheme::Part GetNativeThemePart() const;
+ ui::NativeTheme::State GetNativeThemeState() const;
Type type_;
};
@@ -63,9 +63,9 @@ class ScrollBarThumb : public BaseScrollBarThumb {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
private:
- gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
- gfx::NativeTheme::Part GetNativeThemePart() const;
- gfx::NativeTheme::State GetNativeThemeState() const;
+ ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ ui::NativeTheme::Part GetNativeThemePart() const;
+ ui::NativeTheme::State GetNativeThemeState() const;
ScrollBar* scroll_bar_;
};
@@ -86,22 +86,22 @@ ScrollBarButton::~ScrollBarButton() {
}
gfx::Size ScrollBarButton::GetPreferredSize() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarButton::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
gfx::Rect bounds(GetPreferredSize());
native_theme->Paint(canvas->sk_canvas(), GetNativeThemePart(),
GetNativeThemeState(), bounds, GetNativeThemeParams());
}
-gfx::NativeTheme::ExtraParams
+ui::NativeTheme::ExtraParams
ScrollBarButton::GetNativeThemeParams() const {
- gfx::NativeTheme::ExtraParams params;
+ ui::NativeTheme::ExtraParams params;
switch (state_) {
case CustomButton::BS_HOT:
@@ -115,39 +115,39 @@ gfx::NativeTheme::ExtraParams
return params;
}
-gfx::NativeTheme::Part
+ui::NativeTheme::Part
ScrollBarButton::GetNativeThemePart() const {
switch (type_) {
case UP:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
case DOWN:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
case LEFT:
- return gfx::NativeTheme::kScrollbarLeftArrow;
+ return ui::NativeTheme::kScrollbarLeftArrow;
case RIGHT:
- return gfx::NativeTheme::kScrollbarRightArrow;
+ return ui::NativeTheme::kScrollbarRightArrow;
default:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
}
}
-gfx::NativeTheme::State
+ui::NativeTheme::State
ScrollBarButton::GetNativeThemeState() const {
- gfx::NativeTheme::State state;
+ ui::NativeTheme::State state;
switch (state_) {
case CustomButton::BS_HOT:
- state = gfx::NativeTheme::kHovered;
+ state = ui::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = gfx::NativeTheme::kPressed;
+ state = ui::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = gfx::NativeTheme::kDisabled;
+ state = ui::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = gfx::NativeTheme::kNormal;
+ state = ui::NativeTheme::kNormal;
break;
}
@@ -168,14 +168,14 @@ ScrollBarThumb::~ScrollBarThumb() {
}
gfx::Size ScrollBarThumb::GetPreferredSize() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
native_theme->Paint(canvas->sk_canvas(),
GetNativeThemePart(),
@@ -184,9 +184,9 @@ void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
GetNativeThemeParams());
}
-gfx::NativeTheme::ExtraParams
+ui::NativeTheme::ExtraParams
ScrollBarThumb::GetNativeThemeParams() const {
- gfx::NativeTheme::ExtraParams params;
+ ui::NativeTheme::ExtraParams params;
switch (GetState()) {
case CustomButton::BS_HOT:
@@ -200,28 +200,28 @@ gfx::NativeTheme::ExtraParams
return params;
}
-gfx::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
+ui::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
if (scroll_bar_->IsHorizontal())
- return gfx::NativeTheme::kScrollbarHorizontalThumb;
- return gfx::NativeTheme::kScrollbarVerticalThumb;
+ return ui::NativeTheme::kScrollbarHorizontalThumb;
+ return ui::NativeTheme::kScrollbarVerticalThumb;
}
-gfx::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
- gfx::NativeTheme::State state;
+ui::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
+ ui::NativeTheme::State state;
switch (GetState()) {
case CustomButton::BS_HOT:
- state = gfx::NativeTheme::kHovered;
+ state = ui::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = gfx::NativeTheme::kPressed;
+ state = ui::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = gfx::NativeTheme::kDisabled;
+ state = ui::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = gfx::NativeTheme::kNormal;
+ state = ui::NativeTheme::kNormal;
break;
}
@@ -246,15 +246,15 @@ NativeScrollBarViews::NativeScrollBarViews(NativeScrollBar* scroll_bar)
prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT);
next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT);
- part_ = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ part_ = ui::NativeTheme::kScrollbarHorizontalTrack;
} else {
prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP);
next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN);
- part_ = gfx::NativeTheme::kScrollbarVerticalTrack;
+ part_ = ui::NativeTheme::kScrollbarVerticalTrack;
}
- state_ = gfx::NativeTheme::kNormal;
+ state_ = ui::NativeTheme::kNormal;
AddChildView(prev_button_);
AddChildView(next_button_);
@@ -285,7 +285,7 @@ void NativeScrollBarViews::Layout() {
}
void NativeScrollBarViews::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
gfx::Rect bounds = GetTrackBounds();
if (bounds.IsEmpty())
@@ -386,20 +386,20 @@ NativeScrollBarWrapper* NativeScrollBarWrapper::CreateWrapper(
// static
int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams button_params;
+ ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarLeftArrow,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarLeftArrow,
+ ui::NativeTheme::kNormal,
button_params);
- gfx::NativeTheme::ExtraParams thumb_params;
+ ui::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarHorizontalThumb,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarHorizontalThumb,
+ ui::NativeTheme::kNormal,
thumb_params);
return std::max(track_size.height(), button_size.height());
@@ -407,20 +407,20 @@ int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
// static
int NativeScrollBarWrapper::GetVerticalScrollBarWidth() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams button_params;
+ ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarUpArrow,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarUpArrow,
+ ui::NativeTheme::kNormal,
button_params);
- gfx::NativeTheme::ExtraParams thumb_params;
+ ui::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarVerticalThumb,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarVerticalThumb,
+ ui::NativeTheme::kNormal,
thumb_params);
return std::max(track_size.width(), button_size.width());
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.h b/ui/views/controls/scrollbar/native_scroll_bar_views.h
index 136338c..0335e7f 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.h
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -7,7 +7,7 @@
#pragma once
#include "base/compiler_specific.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/point.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/scrollbar/base_scroll_bar.h"
@@ -69,9 +69,9 @@ class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar,
Button* prev_button_;
Button* next_button_;
- gfx::NativeTheme::ExtraParams params_;
- gfx::NativeTheme::Part part_;
- gfx::NativeTheme::State state_;
+ ui::NativeTheme::ExtraParams params_;
+ ui::NativeTheme::Part part_;
+ ui::NativeTheme::State state_;
DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews);
};