summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 21:06:43 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 21:06:43 +0000
commitc4b52d25fef3a1474d1e271df7088f8c34501550 (patch)
treea573ece1ec05adf4de0605fb5682403d6d0e1678 /views
parent606b25dd473d9da8e94d6eca4c645657c55278b3 (diff)
downloadchromium_src-c4b52d25fef3a1474d1e271df7088f8c34501550.zip
chromium_src-c4b52d25fef3a1474d1e271df7088f8c34501550.tar.gz
chromium_src-c4b52d25fef3a1474d1e271df7088f8c34501550.tar.bz2
Revert 83959 - Merge 83729 - Implement new gray mock.
BUG=chromium-os:14276 TEST=Login, examine both regular and OTR, and test with and without themes. Review URL: http://codereview.chromium.org/6904160 TBR=davemoore@chromium.org Review URL: http://codereview.chromium.org/6910036 TBR=davemoore@chromium.org Review URL: http://codereview.chromium.org/6910038 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@83960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/text_button.cc17
-rw-r--r--views/controls/button/text_button.h8
-rw-r--r--views/window/non_client_view.cc12
-rw-r--r--views/window/non_client_view.h7
-rw-r--r--views/window/window_gtk.cc1
5 files changed, 13 insertions, 32 deletions
diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc
index b085b53..b8e8d72 100644
--- a/views/controls/button/text_button.cc
+++ b/views/controls/button/text_button.cc
@@ -200,7 +200,6 @@ TextButton::TextButton(ButtonListener* listener, const std::wstring& text)
has_shadow_(false),
has_hover_icon_(false),
has_pushed_icon_(false),
- shadow_offset_(gfx::Point(1, 1)),
max_width_(0),
normal_has_border_(false),
show_multiple_icon_states_(true),
@@ -269,11 +268,7 @@ void TextButton::SetTextShadowColors(SkColor active_color,
has_shadow_ = true;
}
-void TextButtonBase::SetTextShadowOffset(int x, int y) {
- shadow_offset_.SetPoint(x, y);
-}
-
-void TextButtonBase::ClearMaxTextSize() {
+void TextButton::ClearMaxTextSize() {
max_text_size_ = text_size_;
}
@@ -285,14 +280,10 @@ void TextButton::SetShowMultipleIconStates(bool show_multiple_icon_states) {
show_multiple_icon_states_ = show_multiple_icon_states;
}
-void TextButtonBase::ClearEmbellishing() {
- has_shadow_ = false;
- has_text_halo_ = false;
-}
-
void TextButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
if (mode == PB_NORMAL) {
OnPaintBackground(canvas);
+
if (show_multiple_icon_states_ && hover_animation_->is_animating()) {
// Draw the hover bitmap into an offscreen buffer, then blend it
// back into the current canvas.
@@ -401,8 +392,8 @@ void TextButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
canvas->DrawStringInt(text_,
font_,
shadow_color,
- text_bounds.x() + shadow_offset_.x(),
- text_bounds.y() + shadow_offset_.y(),
+ text_bounds.x() + 1,
+ text_bounds.y() + 1,
text_bounds.width(),
text_bounds.height(),
draw_string_flags);
diff --git a/views/controls/button/text_button.h b/views/controls/button/text_button.h
index 5998515..f8ab377 100644
--- a/views/controls/button/text_button.h
+++ b/views/controls/button/text_button.h
@@ -152,17 +152,11 @@ class TextButton : public CustomButton {
// inactive. Both possible colors are set in this method, and the
// appropriate one is chosen during Paint.
void SetTextShadowColors(SkColor active_color, SkColor inactive_color);
- void SetTextShadowOffset(int x, int y);
-
- bool normal_has_border() const { return normal_has_border_; }
void SetNormalHasBorder(bool normal_has_border);
// Sets whether or not to show the hot and pushed states for the button icon
// (if present) in addition to the normal state. Defaults to true.
void SetShowMultipleIconStates(bool show_multiple_icon_states);
- // Clears halo and shadow settings.
- void ClearEmbellishing();
-
// Paint the button into the specified canvas. If |mode| is |PB_FOR_DRAG|, the
// function paints a drag image representation into the canvas.
enum PaintButtonMode { PB_NORMAL, PB_FOR_DRAG };
@@ -232,8 +226,6 @@ class TextButton : public CustomButton {
SkColor active_text_shadow_color_;
SkColor inactive_text_shadow_color_;
bool has_shadow_;
- // Space between text and shadow. Defaults to (1,1).
- gfx::Point shadow_offset_;
// An icon displayed with the text.
SkBitmap icon_;
diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc
index 5830d73..021914f 100644
--- a/views/window/non_client_view.cc
+++ b/views/window/non_client_view.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -168,11 +168,6 @@ void NonClientView::ViewHierarchyChanged(bool is_add, View* parent,
}
}
-void NonClientView::GetAccessibleState(ui::AccessibleViewState* state) {
- state->role = ui::AccessibilityTypes::ROLE_WINDOW;
- state->name = accessible_name_;
-}
-
views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) {
// Because of the z-ordering of our child views (the client view is positioned
// over the non-client frame view, if the client view ever overlaps the frame
@@ -189,6 +184,11 @@ views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) {
return View::GetEventHandlerForPoint(point);
}
+void NonClientView::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_WINDOW;
+ state->name = accessible_name_;
+}
+
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, View overrides:
diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h
index d678571..b0b9137 100644
--- a/views/window/non_client_view.h
+++ b/views/window/non_client_view.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -218,13 +218,12 @@ class NonClientView : public View {
virtual void Layout() OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
- virtual views::View* GetEventHandlerForPoint(const gfx::Point& point)
- OVERRIDE;
-
protected:
// NonClientView, View overrides:
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child)
OVERRIDE;
+ virtual views::View* GetEventHandlerForPoint(const gfx::Point& point)
+ OVERRIDE;
private:
// The frame that hosts this NonClientView.
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index a8c96b4..2bd7f54e 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -408,7 +408,6 @@ void WindowGtk::FrameTypeChanged() {
// This is called when the Theme has changed, so forward the event to the root
// widget.
ThemeChanged();
- GetRootView()->SchedulePaint();
}
////////////////////////////////////////////////////////////////////////////////