diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 07:37:29 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 07:37:29 +0000 |
commit | 82522511b7921e8c61742ebd80a4c674c56e7e48 (patch) | |
tree | 381d71de2b9c7b99675e6f2b4523ae0876c72ce8 /views/controls | |
parent | 631cf822bd6e64cf469544b42c9975f5602c29a6 (diff) | |
download | chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.zip chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.tar.gz chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.tar.bz2 |
ChromeCanvas->gfx::Canvas
Rename files too.
TBR=brettw
http://crbug.com/11387
Review URL: http://codereview.chromium.org/113443
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
33 files changed, 99 insertions, 97 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index af6a7b4..0097251 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -4,7 +4,7 @@ #include "views/controls/button/checkbox.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "views/controls/label.h" namespace views { @@ -85,7 +85,7 @@ void Checkbox::Layout() { native_wrapper_->GetView()->Layout(); } -void Checkbox::PaintFocusBorder(ChromeCanvas* canvas) { +void Checkbox::PaintFocusBorder(gfx::Canvas* canvas) { // Our focus border is rendered by the label, so we don't do anything here. } diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index db6706b..86111d1 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -41,7 +41,7 @@ class Checkbox : public NativeButton { // Overridden from View: virtual gfx::Size GetPreferredSize(); virtual void Layout(); - virtual void PaintFocusBorder(ChromeCanvas* canvas); + virtual void PaintFocusBorder(gfx::Canvas* canvas); virtual View* GetViewForPoint(const gfx::Point& point); virtual View* GetViewForPoint(const gfx::Point& point, bool can_create_floating); diff --git a/views/controls/button/image_button.cc b/views/controls/button/image_button.cc index 3c4c7fe..087b4f0 100644 --- a/views/controls/button/image_button.cc +++ b/views/controls/button/image_button.cc @@ -4,7 +4,7 @@ #include "views/controls/button/image_button.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/throb_animation.h" #include "skia/ext/image_operations.h" @@ -20,7 +20,7 @@ ImageButton::ImageButton(ButtonListener* listener) : CustomButton(listener), h_alignment_(ALIGN_LEFT), v_alignment_(ALIGN_TOP) { - // By default, we request that the ChromeCanvas passed to our View::Paint() + // By default, we request that the gfx::Canvas passed to our View::Paint() // implementation is flipped horizontally so that the button's bitmaps are // mirrored when the UI directionality is right-to-left. EnableCanvasFlippingForRTLUI(true); @@ -49,7 +49,7 @@ gfx::Size ImageButton::GetPreferredSize() { return gfx::Size(kDefaultWidth, kDefaultHeight); } -void ImageButton::Paint(ChromeCanvas* canvas) { +void ImageButton::Paint(gfx::Canvas* canvas) { // Call the base class first to paint any background/borders. View::Paint(canvas); diff --git a/views/controls/button/image_button.h b/views/controls/button/image_button.h index da2e0a4..ec3b9ae 100644 --- a/views/controls/button/image_button.h +++ b/views/controls/button/image_button.h @@ -33,7 +33,7 @@ class ImageButton : public CustomButton { // Overridden from View: virtual gfx::Size GetPreferredSize(); - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); protected: // Returns the image to paint. This is invoked from paint and returns a value diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index 6dbf4ae..28045a4 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -5,7 +5,7 @@ #include "views/controls/button/menu_button.h" #include "app/drag_drop_types.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "app/win_util.h" @@ -75,7 +75,7 @@ gfx::Size MenuButton::GetPreferredSize() { return prefsize; } -void MenuButton::Paint(ChromeCanvas* canvas, bool for_drag) { +void MenuButton::Paint(gfx::Canvas* canvas, bool for_drag) { TextButton::Paint(canvas, for_drag); if (show_menu_marker_) { diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h index cbe9ab8..c9a39dd 100644 --- a/views/controls/button/menu_button.h +++ b/views/controls/button/menu_button.h @@ -7,7 +7,7 @@ #include <windows.h> -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "base/time.h" #include "views/background.h" #include "views/controls/button/text_button.h" @@ -44,7 +44,7 @@ class MenuButton : public TextButton { // Overridden to take into account the potential use of a drop marker. virtual gfx::Size GetPreferredSize(); - virtual void Paint(ChromeCanvas* canvas, bool for_drag); + virtual void Paint(gfx::Canvas* canvas, bool for_drag); // These methods are overriden to implement a simple push button // behavior diff --git a/views/controls/button/native_button.h b/views/controls/button/native_button.h index 8b3fbcf..50aaff73 100644 --- a/views/controls/button/native_button.h +++ b/views/controls/button/native_button.h @@ -5,7 +5,7 @@ #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "views/controls/button/button.h" #include "views/controls/button/native_button_wrapper.h" diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc index 4f68b90..9bf9e24 100644 --- a/views/controls/button/text_button.cc +++ b/views/controls/button/text_button.cc @@ -4,7 +4,7 @@ #include "views/controls/button/text_button.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/l10n_util.h" #include "app/throb_animation.h" #include "app/resource_bundle.h" @@ -67,7 +67,7 @@ TextButtonBorder::~TextButtonBorder() { // //////////////////////////////////////////////////////////////////////////////// -void TextButtonBorder::Paint(const View& view, ChromeCanvas* canvas) const { +void TextButtonBorder::Paint(const View& view, gfx::Canvas* canvas) const { const TextButton* mb = static_cast<const TextButton*>(&view); int state = mb->state(); @@ -182,7 +182,7 @@ void TextButton::ClearMaxTextSize() { max_text_size_ = text_size_; } -void TextButton::Paint(ChromeCanvas* canvas, bool for_drag) { +void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) { if (!for_drag) { PaintBackground(canvas); @@ -318,7 +318,7 @@ bool TextButton::OnMousePressed(const MouseEvent& e) { return true; } -void TextButton::Paint(ChromeCanvas* canvas) { +void TextButton::Paint(gfx::Canvas* canvas) { Paint(canvas, false); } diff --git a/views/controls/button/text_button.h b/views/controls/button/text_button.h index e0e547c..8b3d343 100644 --- a/views/controls/button/text_button.h +++ b/views/controls/button/text_button.h @@ -5,7 +5,7 @@ #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "third_party/skia/include/core/SkBitmap.h" #include "views/border.h" #include "views/controls/button/custom_button.h" @@ -26,7 +26,7 @@ class TextButtonBorder : public Border { virtual ~TextButtonBorder(); // Render the background for the provided view - virtual void Paint(const View& view, ChromeCanvas* canvas) const; + virtual void Paint(const View& view, gfx::Canvas* canvas) const; // Returns the insets for the border. virtual void GetInsets(gfx::Insets* insets) const; @@ -92,7 +92,7 @@ class TextButton : public CustomButton { // Paint the button into the specified canvas. If |for_drag| is true, the // function paints a drag image representation into the canvas. - virtual void Paint(ChromeCanvas* canvas, bool for_drag); + virtual void Paint(gfx::Canvas* canvas, bool for_drag); // Overridden from View: virtual gfx::Size GetPreferredSize(); @@ -101,7 +101,7 @@ class TextButton : public CustomButton { protected: virtual bool OnMousePressed(const MouseEvent& e); - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); private: // The text string that is displayed in the button. diff --git a/views/controls/combo_box.cc b/views/controls/combo_box.cc index 1469c32..966509c 100644 --- a/views/controls/combo_box.cc +++ b/views/controls/combo_box.cc @@ -4,8 +4,8 @@ #include "views/controls/combo_box.h" -#include "app/gfx/chrome_canvas.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/canvas.h" +#include "app/gfx/font.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/gfx/native_theme.h" diff --git a/views/controls/hwnd_view.cc b/views/controls/hwnd_view.cc index fdf4042..eaefe6c 100644 --- a/views/controls/hwnd_view.cc +++ b/views/controls/hwnd_view.cc @@ -4,7 +4,7 @@ #include "views/controls/hwnd_view.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "base/logging.h" #include "views/focus/focus_manager.h" #include "views/widget/widget.h" @@ -46,7 +46,7 @@ void HWNDView::Detach() { set_installed_clip(false); } -void HWNDView::Paint(ChromeCanvas* canvas) { +void HWNDView::Paint(gfx::Canvas* canvas) { // The area behind our window is black, so during a fast resize (where our // content doesn't draw over the full size of our HWND, and the HWND // background color doesn't show up), we need to cover that blackness with diff --git a/views/controls/hwnd_view.h b/views/controls/hwnd_view.h index a8d52b3..1ad1ef6 100644 --- a/views/controls/hwnd_view.h +++ b/views/controls/hwnd_view.h @@ -41,7 +41,7 @@ class HWNDView : public NativeViewHost { // TODO(sky): convert this to native_view(). HWND GetHWND() const { return native_view(); } - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); // Overridden from View. virtual std::string GetClassName() const; diff --git a/views/controls/image_view.cc b/views/controls/image_view.cc index 8f58744..10d87b1 100644 --- a/views/controls/image_view.cc +++ b/views/controls/image_view.cc @@ -4,7 +4,7 @@ #include "views/controls/image_view.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "base/logging.h" namespace views { @@ -104,7 +104,7 @@ void ImageView::ComputeImageOrigin(int image_width, int image_height, } } -void ImageView::Paint(ChromeCanvas* canvas) { +void ImageView::Paint(gfx::Canvas* canvas) { View::Paint(canvas); int image_width = image_.width(); int image_height = image_.height(); diff --git a/views/controls/image_view.h b/views/controls/image_view.h index ca4e2ea..0ad8947 100644 --- a/views/controls/image_view.h +++ b/views/controls/image_view.h @@ -8,7 +8,9 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "views/view.h" -class ChromeCanvas; +namespace gfx { +class Canvas; +} namespace views { @@ -71,7 +73,7 @@ class ImageView : public View { // Return whether the image should be centered inside the view. // Overriden from View virtual gfx::Size GetPreferredSize(); - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); // Overriden from View. virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); diff --git a/views/controls/label.cc b/views/controls/label.cc index aed16b9..bf09438 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -6,8 +6,8 @@ #include <math.h> -#include "app/gfx/chrome_canvas.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/canvas.h" +#include "app/gfx/font.h" #include "app/gfx/insets.h" #include "app/gfx/text_elider.h" #include "app/l10n_util.h" @@ -68,7 +68,7 @@ gfx::Size Label::GetPreferredSize() { if (is_multi_line_) { int w = width(), h = 0; - ChromeCanvas::SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags()); + gfx::Canvas::SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags()); prefsize.SetSize(w, h); } else { prefsize = GetTextSize(); @@ -80,18 +80,18 @@ gfx::Size Label::GetPreferredSize() { } int Label::ComputeMultiLineFlags() { - int flags = ChromeCanvas::MULTI_LINE; + int flags = gfx::Canvas::MULTI_LINE; if (allow_character_break_) - flags |= ChromeCanvas::CHARACTER_BREAK; + flags |= gfx::Canvas::CHARACTER_BREAK; switch (horiz_alignment_) { case ALIGN_LEFT: - flags |= ChromeCanvas::TEXT_ALIGN_LEFT; + flags |= gfx::Canvas::TEXT_ALIGN_LEFT; break; case ALIGN_CENTER: - flags |= ChromeCanvas::TEXT_ALIGN_CENTER; + flags |= gfx::Canvas::TEXT_ALIGN_CENTER; break; case ALIGN_RIGHT: - flags |= ChromeCanvas::TEXT_ALIGN_RIGHT; + flags |= gfx::Canvas::TEXT_ALIGN_RIGHT; break; } return flags; @@ -134,7 +134,7 @@ void Label::CalculateDrawStringParams( } } -void Label::Paint(ChromeCanvas* canvas) { +void Label::Paint(gfx::Canvas* canvas) { PaintBackground(canvas); std::wstring paint_text; gfx::Rect text_bounds; @@ -156,8 +156,8 @@ void Label::Paint(ChromeCanvas* canvas) { // We explicitly OR in MULTI_LINE here since SizeStringInt seems to return // an incorrect height for single line text when the MULTI_LINE flag isn't // specified. o_O... - ChromeCanvas::SizeStringInt(paint_text, font_, &w, &h, - flags | ChromeCanvas::MULTI_LINE); + gfx::Canvas::SizeStringInt(paint_text, font_, &w, &h, + flags | gfx::Canvas::MULTI_LINE); gfx::Rect focus_rect = text_bounds; focus_rect.set_width(w); focus_rect.set_height(h); @@ -165,18 +165,18 @@ void Label::Paint(ChromeCanvas* canvas) { // If the label is a single line of text, then the computed text bound // corresponds directly to the text being drawn and no mirroring is needed // for the RTL case. For multiline text, the text bound is an estimation - // and is recomputed in ChromeCanvas::SizeStringInt(). For multiline text + // and is recomputed in gfx::Canvas::SizeStringInt(). For multiline text // in RTL, we need to take mirroring into account when computing the focus // rectangle. int x = focus_rect.x(); - if (flags & ChromeCanvas::MULTI_LINE) + if (flags & gfx::Canvas::MULTI_LINE) x = MirroredLeftPointForRect(focus_rect); canvas->DrawFocusRect(x, focus_rect.y(), focus_rect.width(), focus_rect.height()); } } -void Label::PaintBackground(ChromeCanvas* canvas) { +void Label::PaintBackground(gfx::Canvas* canvas) { const Background* bg = contains_mouse_ ? GetMouseOverBackground() : NULL; if (!bg) bg = background(); @@ -239,7 +239,7 @@ int Label::GetHeightForWidth(int w) { gfx::Insets insets = GetInsets(); w = std::max<int>(0, w - insets.width()); int h = 0; - ChromeCanvas cc(0, 0, true); + gfx::Canvas cc(0, 0, true); cc.SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags()); return h + insets.height(); } diff --git a/views/controls/label.h b/views/controls/label.h index e9ace3f..97b5bc2 100644 --- a/views/controls/label.h +++ b/views/controls/label.h @@ -5,7 +5,7 @@ #ifndef VIEWS_CONTROLS_LABEL_H_ #define VIEWS_CONTROLS_LABEL_H_ -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "googleurl/src/gurl.h" #include "third_party/skia/include/core/SkColor.h" #include "testing/gtest/include/gtest/gtest_prod.h" @@ -67,11 +67,11 @@ class Label : public View { virtual std::string GetClassName() const; // Overridden to paint - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); // If the mouse is over the label, and a mouse over background has been // specified, its used. Otherwise super's implementation is invoked - virtual void PaintBackground(ChromeCanvas* canvas); + virtual void PaintBackground(gfx::Canvas* canvas); // Set the font. void SetFont(const gfx::Font& font); diff --git a/views/controls/label_unittest.cc b/views/controls/label_unittest.cc index 54ee5ca..f9bb484 100644 --- a/views/controls/label_unittest.cc +++ b/views/controls/label_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/l10n_util.h" #include "base/string_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -394,7 +394,7 @@ TEST(LabelTest, DrawMultiLineString) { EXPECT_EQ(0, text_bounds.y()); EXPECT_GT(text_bounds.width(), kMinTextDimension); EXPECT_GT(text_bounds.height(), kMinTextDimension); - EXPECT_EQ(ChromeCanvas::MULTI_LINE | ChromeCanvas::TEXT_ALIGN_CENTER, flags); + EXPECT_EQ(gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER, flags); gfx::Rect center_bounds(text_bounds); label.SetHorizontalAlignment(Label::ALIGN_LEFT); @@ -406,7 +406,7 @@ TEST(LabelTest, DrawMultiLineString) { EXPECT_EQ(0, text_bounds.y()); EXPECT_GT(text_bounds.width(), kMinTextDimension); EXPECT_GT(text_bounds.height(), kMinTextDimension); - EXPECT_EQ(ChromeCanvas::MULTI_LINE | ChromeCanvas::TEXT_ALIGN_LEFT, flags); + EXPECT_EQ(gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_LEFT, flags); label.SetHorizontalAlignment(Label::ALIGN_RIGHT); paint_text.clear(); @@ -417,7 +417,7 @@ TEST(LabelTest, DrawMultiLineString) { EXPECT_EQ(0, text_bounds.y()); EXPECT_GT(text_bounds.width(), kMinTextDimension); EXPECT_GT(text_bounds.height(), kMinTextDimension); - EXPECT_EQ(ChromeCanvas::MULTI_LINE | ChromeCanvas::TEXT_ALIGN_RIGHT, flags); + EXPECT_EQ(gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_RIGHT, flags); // Test multiline drawing with a border. gfx::Insets border(19, 92, 23, 2); @@ -435,7 +435,7 @@ TEST(LabelTest, DrawMultiLineString) { EXPECT_EQ(center_bounds.y() + border.top(), text_bounds.y()); EXPECT_EQ(center_bounds.width(), text_bounds.width()); EXPECT_EQ(center_bounds.height(), text_bounds.height()); - EXPECT_EQ(ChromeCanvas::MULTI_LINE | ChromeCanvas::TEXT_ALIGN_CENTER, flags); + EXPECT_EQ(gfx::Canvas::MULTI_LINE | gfx::Canvas::TEXT_ALIGN_CENTER, flags); } } // namespace views diff --git a/views/controls/link.cc b/views/controls/link.cc index d89ce4d..cd506bf 100644 --- a/views/controls/link.cc +++ b/views/controls/link.cc @@ -4,7 +4,7 @@ #include "views/controls/link.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "views/event.h" namespace views { diff --git a/views/controls/menu/chrome_menu.cc b/views/controls/menu/chrome_menu.cc index f0cf28b..264c8b7 100644 --- a/views/controls/menu/chrome_menu.cc +++ b/views/controls/menu/chrome_menu.cc @@ -8,7 +8,7 @@ #include <uxtheme.h> #include <Vssym32.h> -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/gfx/color_utils.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" @@ -335,7 +335,7 @@ class MenuScrollButton : public View { return DragDropTypes::DRAG_NONE; } - virtual void Paint(ChromeCanvas* canvas) { + virtual void Paint(gfx::Canvas* canvas) { HDC dc = canvas->beginPlatformPaint(); // The background. @@ -430,7 +430,7 @@ class MenuScrollViewContainer : public View { kSubmenuBorderSize, kSubmenuBorderSize)); } - virtual void Paint(ChromeCanvas* canvas) { + virtual void Paint(gfx::Canvas* canvas) { HDC dc = canvas->beginPlatformPaint(); CRect bounds(0, 0, width(), height()); NativeTheme::instance()->PaintMenuBackground( @@ -503,7 +503,7 @@ class MenuSeparator : public View { MenuSeparator() { } - void Paint(ChromeCanvas* canvas) { + void Paint(gfx::Canvas* canvas) { // The gutter is rendered before the background. int start_x = 0; int start_y = height() / 3; @@ -873,7 +873,7 @@ void SubmenuView::DidChangeBounds(const gfx::Rect& previous, SchedulePaint(); } -void SubmenuView::PaintChildren(ChromeCanvas* canvas) { +void SubmenuView::PaintChildren(gfx::Canvas* canvas) { View::PaintChildren(canvas); if (drop_item_ && drop_position_ != MenuDelegate::DROP_ON) @@ -1031,7 +1031,7 @@ MenuScrollViewContainer* SubmenuView::GetScrollViewContainer() { return scroll_view_container_; } -void SubmenuView::PaintDropIndicator(ChromeCanvas* canvas, +void SubmenuView::PaintDropIndicator(gfx::Canvas* canvas, MenuItemView* item, MenuDelegate::DropPosition position) { if (position == MenuDelegate::DROP_NONE) @@ -1210,7 +1210,7 @@ void MenuItemView::SetIcon(const SkBitmap& icon) { SchedulePaint(); } -void MenuItemView::Paint(ChromeCanvas* canvas) { +void MenuItemView::Paint(gfx::Canvas* canvas) { Paint(canvas, false); } @@ -1374,15 +1374,15 @@ void MenuItemView::PrepareForRun(bool has_mnemonics) { int MenuItemView::GetDrawStringFlags() { int flags = 0; if (UILayoutIsRightToLeft()) - flags |= ChromeCanvas::TEXT_ALIGN_RIGHT; + flags |= gfx::Canvas::TEXT_ALIGN_RIGHT; else - flags |= ChromeCanvas::TEXT_ALIGN_LEFT; + flags |= gfx::Canvas::TEXT_ALIGN_LEFT; if (has_mnemonics_) { if (show_mnemonics) - flags |= ChromeCanvas::SHOW_PREFIX; + flags |= gfx::Canvas::SHOW_PREFIX; else - flags |= ChromeCanvas::HIDE_PREFIX; + flags |= gfx::Canvas::HIDE_PREFIX; } return flags; } @@ -1423,7 +1423,7 @@ void MenuItemView::AdjustBoundsForRTLUI(RECT* rect) const { *rect = mirrored_rect.ToRECT(); } -void MenuItemView::Paint(ChromeCanvas* canvas, bool for_drag) { +void MenuItemView::Paint(gfx::Canvas* canvas, bool for_drag) { bool render_selection = (!for_drag && IsSelected() && parent_menu_item_->GetSubmenu()->GetShowSelection(this)); @@ -1824,7 +1824,7 @@ void MenuController::OnMouseDragged(SubmenuView* source, gfx::Point drag_loc(event.location()); View::ConvertPointToScreen(source->GetScrollViewContainer(), &drag_loc); View::ConvertPointToView(NULL, item, &drag_loc); - ChromeCanvas canvas(item->width(), item->height(), false); + gfx::Canvas canvas(item->width(), item->height(), false); item->Paint(&canvas, true); scoped_refptr<OSExchangeData> data(new OSExchangeData); diff --git a/views/controls/menu/chrome_menu.h b/views/controls/menu/chrome_menu.h index 6622cbd..8ff9ec0 100644 --- a/views/controls/menu/chrome_menu.h +++ b/views/controls/menu/chrome_menu.h @@ -9,7 +9,7 @@ #include <vector> #include "app/drag_drop_types.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "base/gfx/point.h" #include "base/gfx/rect.h" #include "base/message_loop.h" @@ -352,7 +352,7 @@ class MenuItemView : public View { int GetCommand() const { return command_; } // Paints the menu item. - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); // Returns the preferred size of this item. virtual gfx::Size GetPreferredSize(); @@ -421,7 +421,7 @@ class MenuItemView : public View { // Actual paint implementation. If for_drag is true, portions of the menu // are not rendered. - void Paint(ChromeCanvas* canvas, bool for_drag); + void Paint(gfx::Canvas* canvas, bool for_drag); // Destroys the window used to display this menu and recursively destroys // the windows used to display all descendants. @@ -517,7 +517,7 @@ class SubmenuView : public View { const gfx::Rect& current); // Painting. - void PaintChildren(ChromeCanvas* canvas); + void PaintChildren(gfx::Canvas* canvas); // Drag and drop methods. These are forwarded to the MenuController. virtual bool CanDrop(const OSExchangeData& data); @@ -578,7 +578,7 @@ class SubmenuView : public View { private: // Paints the drop indicator. This is only invoked if item is non-NULL and // position is not DROP_NONE. - void PaintDropIndicator(ChromeCanvas* canvas, + void PaintDropIndicator(gfx::Canvas* canvas, MenuItemView* item, MenuDelegate::DropPosition position); diff --git a/views/controls/menu/menu_win.cc b/views/controls/menu/menu_win.cc index b10d8dc..eab1816 100644 --- a/views/controls/menu/menu_win.cc +++ b/views/controls/menu/menu_win.cc @@ -12,8 +12,8 @@ #include <atlmisc.h> #include <string> -#include "app/gfx/chrome_canvas.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/canvas.h" +#include "app/gfx/font.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" #include "base/gfx/rect.h" @@ -188,7 +188,7 @@ class MenuHostWindow : public CWindowImpl<MenuHostWindow, CWindow, // Draw the icon after the label, otherwise it would be covered // by the label. if (data->icon.width() != 0 && data->icon.height() != 0) { - ChromeCanvas canvas(data->icon.width(), data->icon.height(), false); + gfx::Canvas canvas(data->icon.width(), data->icon.height(), false); canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); canvas.DrawBitmapInt(data->icon, 0, 0); canvas.getTopPlatformDevice().drawToHDC(hDC, lpdis->rcItem.left + diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc index 6b0b7df..fefed51 100644 --- a/views/controls/native_control.cc +++ b/views/controls/native_control.cc @@ -317,7 +317,7 @@ void NativeControl::SetEnabled(bool enabled) { } } -void NativeControl::Paint(ChromeCanvas* canvas) { +void NativeControl::Paint(gfx::Canvas* canvas) { } void NativeControl::VisibilityChanged(View* starting_from, bool is_visible) { diff --git a/views/controls/native_control.h b/views/controls/native_control.h index 39022a2..22c0fa4 100644 --- a/views/controls/native_control.h +++ b/views/controls/native_control.h @@ -43,7 +43,7 @@ class NativeControl : public View { virtual void SetEnabled(bool enabled); // Overridden to do nothing. - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); protected: friend class NativeControlContainer; diff --git a/views/controls/scrollbar/bitmap_scroll_bar.cc b/views/controls/scrollbar/bitmap_scroll_bar.cc index 4fe8934..2d0fbdf 100644 --- a/views/controls/scrollbar/bitmap_scroll_bar.cc +++ b/views/controls/scrollbar/bitmap_scroll_bar.cc @@ -4,7 +4,7 @@ #include "views/controls/scrollbar/bitmap_scroll_bar.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/l10n_util.h" #include "base/compiler_specific.h" #include "base/message_loop.h" @@ -140,7 +140,7 @@ class BitmapScrollBarThumb : public View { protected: // View overrides: - virtual void Paint(ChromeCanvas* canvas) { + virtual void Paint(gfx::Canvas* canvas) { canvas->DrawBitmapInt(*start_cap_bitmap(), 0, 0); int top_cap_height = start_cap_bitmap()->height(); int bottom_cap_height = end_cap_bitmap()->height(); @@ -391,7 +391,7 @@ gfx::Size BitmapScrollBar::GetPreferredSize() { return gfx::Size(button_prefsize.width(), button_prefsize.height() * 2); } -void BitmapScrollBar::Paint(ChromeCanvas* canvas) { +void BitmapScrollBar::Paint(gfx::Canvas* canvas) { // Paint the track. gfx::Rect track_bounds = GetTrackBounds(); canvas->TileImageInt(*images_[THUMB_TRACK][thumb_track_state_], diff --git a/views/controls/scrollbar/bitmap_scroll_bar.h b/views/controls/scrollbar/bitmap_scroll_bar.h index 45e3535..904830e 100644 --- a/views/controls/scrollbar/bitmap_scroll_bar.h +++ b/views/controls/scrollbar/bitmap_scroll_bar.h @@ -95,7 +95,7 @@ class BitmapScrollBar : public ScrollBar, // View overrides: virtual gfx::Size GetPreferredSize(); - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); virtual void Layout(); virtual bool OnMousePressed(const MouseEvent& event); virtual void OnMouseReleased(const MouseEvent& event, bool canceled); diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc index 4558ffd..b40fca2 100644 --- a/views/controls/single_split_view.cc +++ b/views/controls/single_split_view.cc @@ -4,7 +4,7 @@ #include "views/controls/single_split_view.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "skia/ext/skia_utils_win.h" #include "views/background.h" diff --git a/views/controls/tabbed_pane.cc b/views/controls/tabbed_pane.cc index 04b7273..a162131 100644 --- a/views/controls/tabbed_pane.cc +++ b/views/controls/tabbed_pane.cc @@ -6,8 +6,8 @@ #include <vssym32.h> -#include "app/gfx/chrome_canvas.h" -#include "app/gfx/chrome_font.h" +#include "app/gfx/canvas.h" +#include "app/gfx/font.h" #include "app/l10n_util_win.h" #include "app/resource_bundle.h" #include "base/gfx/native_theme.h" @@ -37,7 +37,7 @@ class TabBackground : public Background { } virtual ~TabBackground() {} - virtual void Paint(ChromeCanvas* canvas, View* view) const { + virtual void Paint(gfx::Canvas* canvas, View* view) const { HDC dc = canvas->beginPlatformPaint(); RECT r = {0, 0, view->width(), view->height()}; gfx::NativeTheme::instance()->PaintTabPanelBackground(dc, &r); diff --git a/views/controls/table/group_table_view.cc b/views/controls/table/group_table_view.cc index b5d5698..5f26756 100644 --- a/views/controls/table/group_table_view.cc +++ b/views/controls/table/group_table_view.cc @@ -4,7 +4,7 @@ #include "views/controls/table/group_table_view.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "base/compiler_specific.h" #include "base/message_loop.h" #include "base/task.h" diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc index a476da3..da4aeb04 100644 --- a/views/controls/table/table_view.cc +++ b/views/controls/table/table_view.cc @@ -11,7 +11,7 @@ #include <algorithm> -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/gfx/favicon_size.h" #include "app/gfx/icon_util.h" #include "app/l10n_util_win.h" @@ -866,7 +866,7 @@ HWND TableView::CreateNativeControl(HWND parent_container) { // We create 2 phony images because we are going to switch images at every // refresh in order to force a refresh of the icon area (somehow the clip // rect does not include the icon). - ChromeCanvas canvas(kImageSize, kImageSize, false); + gfx::Canvas canvas(kImageSize, kImageSize, false); // Make the background completely transparent. canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); HICON empty_icon = @@ -1245,7 +1245,7 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { client_rect.top += content_offset_; // Make sure the region need to paint is visible. if (intersection.IntersectRect(&icon_rect, &client_rect)) { - ChromeCanvas canvas(icon_rect.Width(), icon_rect.Height(), false); + gfx::Canvas canvas(icon_rect.Width(), icon_rect.Height(), false); // It seems the state in nmcd.uItemState is not correct. // We'll retrieve it explicitly. diff --git a/views/controls/text_field.h b/views/controls/text_field.h index c49c7d7..339580d 100644 --- a/views/controls/text_field.h +++ b/views/controls/text_field.h @@ -10,7 +10,7 @@ #include <string> -#include "app/gfx/chrome_font.h" +#include "app/gfx/font.h" #include "base/basictypes.h" #include "views/view.h" #include "third_party/skia/include/core/SkColor.h" diff --git a/views/controls/throbber.cc b/views/controls/throbber.cc index 5f10f1f..e15fcb3 100644 --- a/views/controls/throbber.cc +++ b/views/controls/throbber.cc @@ -4,7 +4,7 @@ #include "views/controls/throbber.h" -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/resource_bundle.h" #include "base/time.h" #include "grit/theme_resources.h" @@ -66,7 +66,7 @@ gfx::Size Throbber::GetPreferredSize() { return gfx::Size(frames_->height(), frames_->height()); } -void Throbber::Paint(ChromeCanvas* canvas) { +void Throbber::Paint(gfx::Canvas* canvas) { if (!running_ && !paint_while_stopped_) return; @@ -140,7 +140,7 @@ void CheckmarkThrobber::SetChecked(bool checked) { } } -void CheckmarkThrobber::Paint(ChromeCanvas* canvas) { +void CheckmarkThrobber::Paint(gfx::Canvas* canvas) { if (running_) { // Let the throbber throb... Throbber::Paint(canvas); diff --git a/views/controls/throbber.h b/views/controls/throbber.h index bd0e67a..53d669f 100644 --- a/views/controls/throbber.h +++ b/views/controls/throbber.h @@ -31,7 +31,7 @@ class Throbber : public View { // overridden from View virtual gfx::Size GetPreferredSize(); - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); protected: // Specifies whether the throbber is currently animating or not @@ -90,7 +90,7 @@ class CheckmarkThrobber : public Throbber { void SetChecked(bool checked); // Overridden from Throbber: - virtual void Paint(ChromeCanvas* canvas); + virtual void Paint(gfx::Canvas* canvas); private: static const int kFrameTimeMs = 30; diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc index 39e6103..ceaa461 100644 --- a/views/controls/tree/tree_view.cc +++ b/views/controls/tree/tree_view.cc @@ -8,7 +8,7 @@ #include <atlapp.h> #include <atlmisc.h> -#include "app/gfx/chrome_canvas.h" +#include "app/gfx/canvas.h" #include "app/gfx/icon_util.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" @@ -684,13 +684,13 @@ LRESULT CALLBACK TreeView::TreeWndProc(HWND window, return 1; case WM_PAINT: { - ChromeCanvasPaint canvas(window); + gfx::CanvasPaint canvas(window); if (canvas.isEmpty()) return 0; HDC dc = canvas.beginPlatformPaint(); if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { - // ChromeCanvas ends up configuring the DC with a mode of GM_ADVANCED. + // gfx::Canvas ends up configuring the DC with a mode of GM_ADVANCED. // For some reason a graphics mode of ADVANCED triggers all the text // to be mirrored when RTL. Set the mode back to COMPATIBLE and // explicitly set the layout. Additionally SetWorldTransform and |