summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 07:37:29 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 07:37:29 +0000
commit82522511b7921e8c61742ebd80a4c674c56e7e48 (patch)
tree381d71de2b9c7b99675e6f2b4523ae0876c72ce8
parent631cf822bd6e64cf469544b42c9975f5602c29a6 (diff)
downloadchromium_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
-rw-r--r--app/DEPS8
-rw-r--r--app/app.vcproj16
-rw-r--r--app/gfx/canvas.cc (renamed from app/gfx/chrome_canvas.cc)77
-rw-r--r--app/gfx/canvas.h (renamed from app/gfx/chrome_canvas.h)40
-rw-r--r--app/gfx/canvas_linux.cc (renamed from app/gfx/chrome_canvas_linux.cc)38
-rw-r--r--app/gfx/canvas_win.cc (renamed from app/gfx/chrome_canvas_win.cc)76
-rw-r--r--app/gfx/font.h (renamed from app/gfx/chrome_font.h)2
-rw-r--r--app/gfx/font_gtk.cc (renamed from app/gfx/chrome_font_gtk.cc)2
-rw-r--r--app/gfx/font_mac.mm (renamed from app/gfx/chrome_font_mac.mm)2
-rw-r--r--app/gfx/font_skia.cc (renamed from app/gfx/chrome_font_skia.cc)2
-rw-r--r--app/gfx/font_unittest.cc (renamed from app/gfx/chrome_font_unittest.cc)2
-rw-r--r--app/gfx/font_win.cc (renamed from app/gfx/chrome_font_win.cc)3
-rw-r--r--app/gfx/icon_util.h6
-rw-r--r--app/gfx/insets.h6
-rw-r--r--app/gfx/path.h6
-rw-r--r--app/gfx/text_elider.cc2
-rw-r--r--app/gfx/text_elider.h8
-rw-r--r--app/gfx/text_elider_unittest.cc2
-rw-r--r--app/l10n_util.cc6
-rw-r--r--app/l10n_util.h8
-rw-r--r--app/resource_bundle.cc2
-rw-r--r--app/resource_bundle_linux.cc2
-rw-r--r--app/resource_bundle_mac.mm2
-rw-r--r--app/resource_bundle_win.cc2
-rw-r--r--app/win_util.h2
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc4
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.h2
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_win.cc6
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_win.h2
-rw-r--r--chrome/browser/debugger/debugger_view.cc4
-rw-r--r--chrome/browser/debugger/debugger_view.h2
-rw-r--r--chrome/browser/download/download_util.cc4
-rw-r--r--chrome/browser/download/download_util.h6
-rw-r--r--chrome/browser/extensions/extension_shelf.cc4
-rw-r--r--chrome/browser/extensions/extension_shelf.h6
-rw-r--r--chrome/browser/gtk/download_item_gtk.cc6
-rw-r--r--chrome/browser/gtk/sad_tab_gtk.cc14
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.cc10
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.h12
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc4
-rw-r--r--chrome/browser/printing/printed_document.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_unittest.cc6
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc10
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_win.cc4
-rw-r--r--chrome/browser/views/about_chrome_view.cc16
-rw-r--r--chrome/browser/views/about_chrome_view.h6
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc34
-rw-r--r--chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h6
-rw-r--r--chrome/browser/views/blocked_popup_container.cc4
-rw-r--r--chrome/browser/views/blocked_popup_container.h2
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc14
-rw-r--r--chrome/browser/views/bookmark_bar_view.h4
-rw-r--r--chrome/browser/views/bookmark_bubble_view.cc2
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc4
-rw-r--r--chrome/browser/views/bookmark_manager_view.h2
-rw-r--r--chrome/browser/views/bookmark_table_view.cc6
-rw-r--r--chrome/browser/views/constrained_window_impl.cc20
-rw-r--r--chrome/browser/views/download_item_view.cc6
-rw-r--r--chrome/browser/views/download_item_view.h6
-rw-r--r--chrome/browser/views/download_shelf_view.cc6
-rw-r--r--chrome/browser/views/download_shelf_view.h4
-rw-r--r--chrome/browser/views/find_bar_view.cc4
-rw-r--r--chrome/browser/views/find_bar_view.h2
-rw-r--r--chrome/browser/views/frame/browser_view.cc4
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.cc12
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.h10
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.cc20
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.h16
-rw-r--r--chrome/browser/views/fullscreen_exit_bubble.cc6
-rw-r--r--chrome/browser/views/hung_renderer_view.cc2
-rw-r--r--chrome/browser/views/info_bubble.cc4
-rw-r--r--chrome/browser/views/info_bubble.h2
-rw-r--r--chrome/browser/views/infobars/infobars.cc4
-rw-r--r--chrome/browser/views/location_bar_view.cc8
-rw-r--r--chrome/browser/views/location_bar_view.h10
-rw-r--r--chrome/browser/views/options/advanced_contents_view.cc4
-rw-r--r--chrome/browser/views/options/content_page_view.cc6
-rw-r--r--chrome/browser/views/options/cookies_view.cc2
-rw-r--r--chrome/browser/views/options/fonts_page_view.cc8
-rw-r--r--chrome/browser/views/options/languages_page_view.cc4
-rw-r--r--chrome/browser/views/options/options_group_view.cc6
-rw-r--r--chrome/browser/views/options/options_group_view.h2
-rw-r--r--chrome/browser/views/sad_tab_view.cc12
-rw-r--r--chrome/browser/views/sad_tab_view.h4
-rw-r--r--chrome/browser/views/shell_dialogs_win.cc2
-rw-r--r--chrome/browser/views/star_toggle.cc4
-rw-r--r--chrome/browser/views/star_toggle.h2
-rw-r--r--chrome/browser/views/status_bubble_views.cc6
-rw-r--r--chrome/browser/views/tab_icon_view.cc10
-rw-r--r--chrome/browser/views/tab_icon_view.h8
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc6
-rw-r--r--chrome/browser/views/tabs/dragged_tab_view.cc12
-rw-r--r--chrome/browser/views/tabs/dragged_tab_view.h8
-rw-r--r--chrome/browser/views/tabs/hwnd_photobooth.cc4
-rw-r--r--chrome/browser/views/tabs/hwnd_photobooth.h6
-rw-r--r--chrome/browser/views/tabs/tab.cc2
-rw-r--r--chrome/browser/views/tabs/tab_renderer.cc16
-rw-r--r--chrome/browser/views/tabs/tab_renderer.h12
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc4
-rw-r--r--chrome/browser/views/tabs/tab_strip.h2
-rw-r--r--chrome/browser/views/theme_helpers.cc4
-rw-r--r--chrome/browser/views/toolbar_view.cc4
-rw-r--r--chrome/browser/views/toolbar_view.h2
-rw-r--r--chrome/chrome.gyp22
-rw-r--r--chrome/plugin/webplugin_proxy.cc2
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc4
-rw-r--r--chrome/test/unit/unittests.vcproj8
-rw-r--r--views/DEPS5
-rw-r--r--views/background.cc6
-rw-r--r--views/background.h6
-rw-r--r--views/border.cc8
-rw-r--r--views/border.h6
-rw-r--r--views/controls/button/checkbox.cc4
-rw-r--r--views/controls/button/checkbox.h2
-rw-r--r--views/controls/button/image_button.cc6
-rw-r--r--views/controls/button/image_button.h2
-rw-r--r--views/controls/button/menu_button.cc4
-rw-r--r--views/controls/button/menu_button.h4
-rw-r--r--views/controls/button/native_button.h2
-rw-r--r--views/controls/button/text_button.cc8
-rw-r--r--views/controls/button/text_button.h8
-rw-r--r--views/controls/combo_box.cc4
-rw-r--r--views/controls/hwnd_view.cc4
-rw-r--r--views/controls/hwnd_view.h2
-rw-r--r--views/controls/image_view.cc4
-rw-r--r--views/controls/image_view.h6
-rw-r--r--views/controls/label.cc30
-rw-r--r--views/controls/label.h6
-rw-r--r--views/controls/label_unittest.cc10
-rw-r--r--views/controls/link.cc2
-rw-r--r--views/controls/menu/chrome_menu.cc26
-rw-r--r--views/controls/menu/chrome_menu.h10
-rw-r--r--views/controls/menu/menu_win.cc6
-rw-r--r--views/controls/native_control.cc2
-rw-r--r--views/controls/native_control.h2
-rw-r--r--views/controls/scrollbar/bitmap_scroll_bar.cc6
-rw-r--r--views/controls/scrollbar/bitmap_scroll_bar.h2
-rw-r--r--views/controls/single_split_view.cc2
-rw-r--r--views/controls/tabbed_pane.cc6
-rw-r--r--views/controls/table/group_table_view.cc2
-rw-r--r--views/controls/table/table_view.cc6
-rw-r--r--views/controls/text_field.h2
-rw-r--r--views/controls/throbber.cc6
-rw-r--r--views/controls/throbber.h4
-rw-r--r--views/controls/tree/tree_view.cc6
-rw-r--r--views/drag_utils.cc14
-rw-r--r--views/drag_utils.h6
-rw-r--r--views/painter.cc10
-rw-r--r--views/painter.h12
-rw-r--r--views/view.cc14
-rw-r--r--views/view.h22
-rw-r--r--views/view_unittest.cc8
-rw-r--r--views/view_win.cc2
-rw-r--r--views/widget/root_view.cc4
-rw-r--r--views/widget/root_view.h2
-rw-r--r--views/widget/root_view_gtk.cc4
-rw-r--r--views/widget/root_view_win.cc4
-rw-r--r--views/widget/widget_win.cc8
-rw-r--r--views/widget/widget_win.h5
-rw-r--r--views/window/custom_frame_view.cc14
-rw-r--r--views/window/custom_frame_view.h12
-rw-r--r--views/window/dialog_client_view.cc12
-rw-r--r--views/window/dialog_client_view.h8
-rw-r--r--views/window/window_win.cc10
165 files changed, 644 insertions, 630 deletions
diff --git a/app/DEPS b/app/DEPS
index a087ecf..cffa9e0 100644
--- a/app/DEPS
+++ b/app/DEPS
@@ -1,11 +1,11 @@
include_rules = [
- # TODO(beng): Modify this link to be more specific about what resource
- # headers are included once app gets its own strings.
- "+grit",
+ # TODO(beng): swap these with app/views specific generated resources.
+ "+grit/generated_resources.h",
+ "+grit/locale_settings.h",
+ "+grit/theme_resources.h",
"+net",
# TODO(beng): Sever these links once we have extracted all deps from
# chrome/common.
"+chrome/common/chrome_paths.h",
-
"+skia",
]
diff --git a/app/app.vcproj b/app/app.vcproj
index 37a051d..92b555c 100644
--- a/app/app.vcproj
+++ b/app/app.vcproj
@@ -125,35 +125,35 @@
Name="gfx"
>
<File
- RelativePath=".\gfx\chrome_canvas.cc"
+ RelativePath=".\gfx\canvas.cc"
>
</File>
<File
- RelativePath=".\gfx\chrome_canvas.h"
+ RelativePath=".\gfx\canvas.h"
>
</File>
<File
- RelativePath=".\gfx\chrome_canvas_win.cc"
+ RelativePath=".\gfx\canvas_win.cc"
>
</File>
<File
- RelativePath=".\gfx\chrome_font.h"
+ RelativePath=".\gfx\color_utils.cc"
>
</File>
<File
- RelativePath=".\gfx\chrome_font_win.cc"
+ RelativePath=".\gfx\color_utils.h"
>
</File>
<File
- RelativePath=".\gfx\color_utils.cc"
+ RelativePath=".\gfx\favicon_size.h"
>
</File>
<File
- RelativePath=".\gfx\color_utils.h"
+ RelativePath=".\gfx\font.h"
>
</File>
<File
- RelativePath=".\gfx\favicon_size.h"
+ RelativePath=".\gfx\font_win.cc"
>
</File>
<File
diff --git a/app/gfx/chrome_canvas.cc b/app/gfx/canvas.cc
index 4419b0f..8df6b39 100644
--- a/app/gfx/chrome_canvas.cc
+++ b/app/gfx/canvas.cc
@@ -2,17 +2,19 @@
// 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 <limits>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkShader.h"
-bool ChromeCanvas::GetClipRect(gfx::Rect* r) {
+namespace gfx {
+
+bool Canvas::GetClipRect(gfx::Rect* r) {
SkRect clip;
if (!getClipBounds(&clip)) {
if (r)
@@ -25,30 +27,29 @@ bool ChromeCanvas::GetClipRect(gfx::Rect* r) {
return true;
}
-bool ChromeCanvas::ClipRectInt(int x, int y, int w, int h) {
+bool Canvas::ClipRectInt(int x, int y, int w, int h) {
SkRect new_clip;
new_clip.set(SkIntToScalar(x), SkIntToScalar(y),
SkIntToScalar(x + w), SkIntToScalar(y + h));
return clipRect(new_clip);
}
-bool ChromeCanvas::IntersectsClipRectInt(int x, int y, int w, int h) {
+bool Canvas::IntersectsClipRectInt(int x, int y, int w, int h) {
SkRect clip;
return getClipBounds(&clip) &&
clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w),
SkIntToScalar(y + h));
}
-void ChromeCanvas::TranslateInt(int x, int y) {
+void Canvas::TranslateInt(int x, int y) {
translate(SkIntToScalar(x), SkIntToScalar(y));
}
-void ChromeCanvas::ScaleInt(int x, int y) {
+void Canvas::ScaleInt(int x, int y) {
scale(SkIntToScalar(x), SkIntToScalar(y));
}
-void ChromeCanvas::FillRectInt(const SkColor& color,
- int x, int y, int w, int h) {
+void Canvas::FillRectInt(const SkColor& color, int x, int y, int w, int h) {
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
@@ -56,20 +57,17 @@ void ChromeCanvas::FillRectInt(const SkColor& color,
FillRectInt(x, y, w, h, paint);
}
-void ChromeCanvas::FillRectInt(int x, int y, int w, int h,
- const SkPaint& paint) {
+void Canvas::FillRectInt(int x, int y, int w, int h, const SkPaint& paint) {
SkIRect rc = {x, y, x + w, y + h};
drawIRect(rc, paint);
}
-void ChromeCanvas::DrawRectInt(const SkColor& color,
- int x, int y, int w, int h) {
+void Canvas::DrawRectInt(const SkColor& color, int x, int y, int w, int h) {
DrawRectInt(color, x, y, w, h, SkPorterDuff::kSrcOver_Mode);
}
-void ChromeCanvas::DrawRectInt(const SkColor& color,
- int x, int y, int w, int h,
- SkPorterDuff::Mode mode) {
+void Canvas::DrawRectInt(const SkColor& color, int x, int y, int w, int h,
+ SkPorterDuff::Mode mode) {
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kStroke_Style);
@@ -83,8 +81,7 @@ void ChromeCanvas::DrawRectInt(const SkColor& color,
drawIRect(rc, paint);
}
-void ChromeCanvas::DrawLineInt(const SkColor& color,
- int x1, int y1, int x2, int y2) {
+void Canvas::DrawLineInt(const SkColor& color, int x1, int y1, int x2, int y2) {
SkPaint paint;
paint.setColor(color);
paint.setStrokeWidth(SkIntToScalar(1));
@@ -92,7 +89,7 @@ void ChromeCanvas::DrawLineInt(const SkColor& color,
SkIntToScalar(y2), paint);
}
-void ChromeCanvas::DrawFocusRect(int x, int y, int width, int height) {
+void Canvas::DrawFocusRect(int x, int y, int width, int height) {
// Create a 2D bitmap containing alternating on/off pixels - we do this
// so that you never get two pixels of the same color around the edges
// of the focus rect (this may mean that opposing edges of the rect may
@@ -146,28 +143,28 @@ void ChromeCanvas::DrawFocusRect(int x, int y, int width, int height) {
drawRect(rect, paint);
}
-void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {
+void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {
drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y));
}
-void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y,
- const SkPaint& paint) {
+void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y,
+ const SkPaint& paint) {
drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y), &paint);
}
-void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
- int src_w, int src_h, int dest_x, int dest_y,
- int dest_w, int dest_h,
- bool filter) {
+void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
+ int src_w, int src_h, int dest_x, int dest_y,
+ int dest_w, int dest_h,
+ bool filter) {
SkPaint p;
DrawBitmapInt(bitmap, src_x, src_y, src_w, src_h, dest_x, dest_y,
dest_w, dest_h, filter, p);
}
-void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
- int src_w, int src_h, int dest_x, int dest_y,
- int dest_w, int dest_h,
- bool filter, const SkPaint& paint) {
+void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
+ int src_w, int src_h, int dest_x, int dest_y,
+ int dest_w, int dest_h,
+ bool filter, const SkPaint& paint) {
DLOG_ASSERT(src_x + src_w < std::numeric_limits<int16_t>::max() &&
src_y + src_h < std::numeric_limits<int16_t>::max());
if (src_w <= 0 || src_h <= 0 || dest_w <= 0 || dest_h <= 0) {
@@ -216,22 +213,20 @@ void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
drawRect(dest_rect, p);
}
-void ChromeCanvas::DrawStringInt(const std::wstring& text,
- const gfx::Font& font,
- const SkColor& color,
- int x, int y,
- int w, int h) {
+void Canvas::DrawStringInt(const std::wstring& text,
+ const gfx::Font& font,
+ const SkColor& color,
+ int x, int y, int w, int h) {
DrawStringInt(text, font, color, x, y, w, h,
l10n_util::DefaultCanvasTextAlignment());
}
-void ChromeCanvas::TileImageInt(const SkBitmap& bitmap,
- int x, int y, int w, int h) {
+void Canvas::TileImageInt(const SkBitmap& bitmap, int x, int y, int w, int h) {
TileImageInt(bitmap, 0, 0, x, y, w, h);
}
-void ChromeCanvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
- int dest_x, int dest_y, int w, int h) {
+void Canvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
+ int dest_x, int dest_y, int w, int h) {
if (!IntersectsClipRectInt(dest_x, dest_y, w, h))
return;
@@ -253,7 +248,7 @@ void ChromeCanvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
restore();
}
-SkBitmap ChromeCanvas::ExtractBitmap() {
+SkBitmap Canvas::ExtractBitmap() {
const SkBitmap& device_bitmap = getDevice()->accessBitmap(false);
// Make a bitmap to return, and a canvas to draw into it. We don't just want
@@ -263,3 +258,5 @@ SkBitmap ChromeCanvas::ExtractBitmap() {
device_bitmap.copyTo(&result, SkBitmap::kARGB_8888_Config);
return result;
}
+
+} // namespace gfx
diff --git a/app/gfx/chrome_canvas.h b/app/gfx/canvas.h
index 84c5320..e1d20b8 100644
--- a/app/gfx/chrome_canvas.h
+++ b/app/gfx/canvas.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef APP_GFX_CHROME_CANVAS_H_
-#define APP_GFX_CHROME_CANVAS_H_
+#ifndef APP_GFX_CANVAS_H_
+#define APP_GFX_CANVAS_H_
#if defined(OS_WIN)
#include <windows.h>
@@ -14,19 +14,17 @@
#include "base/basictypes.h"
#include "skia/ext/platform_canvas.h"
-namespace gfx {
-class Font;
-class Rect;
-}
-
#if defined(OS_LINUX)
typedef struct _cairo cairo_t;
#endif
-// ChromeCanvas is the SkCanvas used by Views for all painting. It
-// provides a handful of methods for the common operations used throughout
-// Views. With few exceptions, you should NOT create a ChromeCanvas directly,
-// rather one will be passed to you via the various paint methods in view.
+namespace gfx {
+
+class Font;
+class Rect;
+
+// Canvas is a SkCanvas subclass that provides a number of methods for common
+// operations used throughout an application built using base/gfx and app/gfx.
//
// All methods that take integer arguments (as is used throughout views)
// end with Int. If you need to use methods provided by the superclass
@@ -39,7 +37,7 @@ typedef struct _cairo cairo_t;
// source and destination colors are combined. Unless otherwise specified,
// the variant that does not take a SkPorterDuff::Mode uses a transfer mode
// of kSrcOver_Mode.
-class ChromeCanvas : public skia::PlatformCanvas {
+class Canvas : public skia::PlatformCanvas {
public:
// Specifies the alignment for text rendered with the DrawStringInt method.
enum {
@@ -69,13 +67,13 @@ class ChromeCanvas : public skia::PlatformCanvas {
CHARACTER_BREAK = 1024,
};
- // Creates an empty ChromeCanvas. Callers must use initialize before using
- // the canvas.
- ChromeCanvas();
+ // Creates an empty Canvas. Callers must use initialize before using the
+ // canvas.
+ Canvas();
- ChromeCanvas(int width, int height, bool is_opaque);
+ Canvas(int width, int height, bool is_opaque);
- virtual ~ChromeCanvas();
+ virtual ~Canvas();
// Retrieves the clip rectangle and sets it in the specified rectangle if any.
// Returns true if the clip rect is non-empty.
@@ -207,11 +205,13 @@ class ChromeCanvas : public skia::PlatformCanvas {
int flags);
#endif
- DISALLOW_EVIL_CONSTRUCTORS(ChromeCanvas);
+ DISALLOW_COPY_AND_ASSIGN(Canvas);
};
#if defined(OS_WIN) || defined(OS_LINUX)
-typedef skia::CanvasPaintT<ChromeCanvas> ChromeCanvasPaint;
+typedef skia::CanvasPaintT<Canvas> CanvasPaint;
#endif
-#endif // APP_GFX_CHROME_CANVAS_H_
+} // namespace gfx;
+
+#endif // #ifndef APP_GFX_CANVAS_H_
diff --git a/app/gfx/chrome_canvas_linux.cc b/app/gfx/canvas_linux.cc
index 12602d9..feb5b7f 100644
--- a/app/gfx/chrome_canvas_linux.cc
+++ b/app/gfx/canvas_linux.cc
@@ -2,11 +2,11 @@
// 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 <pango/pango.h>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -41,24 +41,26 @@ PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font) {
} // namespace
-ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque)
+namespace gfx {
+
+Canvas::Canvas(int width, int height, bool is_opaque)
: skia::PlatformCanvasLinux(width, height, is_opaque) {
}
-ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasLinux() {
+Canvas::Canvas() : skia::PlatformCanvasLinux() {
}
-ChromeCanvas::~ChromeCanvas() {
+Canvas::~Canvas() {
}
// static
-void ChromeCanvas::SizeStringInt(const std::wstring& text,
- const gfx::Font& font,
- int* width, int* height, int flags) {
+void Canvas::SizeStringInt(const std::wstring& text,
+ const gfx::Font& font,
+ int* width, int* height, int flags) {
NOTIMPLEMENTED();
}
-void ChromeCanvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
+void Canvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
const SkMatrix& skia_matrix = getTotalMatrix();
cairo_matrix_t cairo_matrix;
cairo_matrix_init(&cairo_matrix,
@@ -71,10 +73,10 @@ void ChromeCanvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
cairo_set_matrix(cr, &cairo_matrix);
}
-void ChromeCanvas::DrawStringInt(const std::wstring& text,
- const gfx::Font& font,
- const SkColor& color, int x, int y, int w,
- int h, int flags) {
+void Canvas::DrawStringInt(const std::wstring& text,
+ const gfx::Font& font,
+ const SkColor& color, int x, int y, int w, int h,
+ int flags) {
cairo_surface_t* surface = beginPlatformPaint();
cairo_t* cr = cairo_create(surface);
// We're going to draw onto the surface directly. This circumvents the matrix
@@ -88,8 +90,8 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
SkColorGetG(color) / 255.0,
SkColorGetB(color) / 255.0);
- // TODO(deanm): Implement the rest of the ChromeCanvas flags.
- if (!(flags & ChromeCanvas::NO_ELLIPSIS))
+ // TODO(deanm): Implement the rest of the Canvas flags.
+ if (!(flags & Canvas::NO_ELLIPSIS))
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
pango_layout_set_width(layout, w * PANGO_SCALE);
@@ -119,9 +121,9 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
int width, height;
pango_layout_get_size(layout, &width, &height);
- if (flags & ChromeCanvas::TEXT_VALIGN_TOP) {
+ if (flags & Canvas::TEXT_VALIGN_TOP) {
// Cairo should draw from the top left corner already.
- } else if (flags & ChromeCanvas::TEXT_VALIGN_BOTTOM) {
+ } else if (flags & Canvas::TEXT_VALIGN_BOTTOM) {
y = y + (h - (height / PANGO_SCALE));
} else {
// Vertically centered.
@@ -135,3 +137,5 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
cairo_destroy(cr);
// NOTE: beginPlatformPaint returned its surface, we shouldn't destroy it.
}
+
+} // namespace gfx
diff --git a/app/gfx/chrome_canvas_win.cc b/app/gfx/canvas_win.cc
index 267a510..2d818d4 100644
--- a/app/gfx/chrome_canvas_win.cc
+++ b/app/gfx/canvas_win.cc
@@ -2,11 +2,11 @@
// 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 <limits>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/gfx/rect.h"
#include "third_party/skia/include/core/SkShader.h"
@@ -33,47 +33,47 @@ void DoDrawText(HDC hdc, const std::wstring& text,
DrawText(hdc, string_ptr, string_size, text_bounds, flags);
}
-// Compute the windows flags necessary to implement the provided text
-// ChromeCanvas flags.
+// Compute the windows flags necessary to implement the provided text Canvas
+// flags.
int ComputeFormatFlags(int flags, const std::wstring& text) {
int f = 0;
// Setting the text alignment explicitly in case it hasn't already been set.
// This will make sure that we don't align text to the left on RTL locales
// just because no alignment flag was passed to DrawStringInt().
- if (!(flags & (ChromeCanvas::TEXT_ALIGN_CENTER |
- ChromeCanvas::TEXT_ALIGN_RIGHT |
- ChromeCanvas::TEXT_ALIGN_LEFT))) {
+ if (!(flags & (gfx::Canvas::TEXT_ALIGN_CENTER |
+ gfx::Canvas::TEXT_ALIGN_RIGHT |
+ gfx::Canvas::TEXT_ALIGN_LEFT))) {
flags |= l10n_util::DefaultCanvasTextAlignment();
}
- if (flags & ChromeCanvas::HIDE_PREFIX)
+ if (flags & gfx::Canvas::HIDE_PREFIX)
f |= DT_HIDEPREFIX;
- else if ((flags & ChromeCanvas::SHOW_PREFIX) == 0)
+ else if ((flags & gfx::Canvas::SHOW_PREFIX) == 0)
f |= DT_NOPREFIX;
- if (flags & ChromeCanvas::MULTI_LINE) {
+ if (flags & gfx::Canvas::MULTI_LINE) {
f |= DT_WORDBREAK;
- if (flags & ChromeCanvas::CHARACTER_BREAK)
+ if (flags & gfx::Canvas::CHARACTER_BREAK)
f |= DT_EDITCONTROL;
} else {
f |= DT_SINGLELINE | DT_VCENTER;
- if (!(flags & ChromeCanvas::NO_ELLIPSIS))
+ if (!(flags & gfx::Canvas::NO_ELLIPSIS))
f |= DT_END_ELLIPSIS;
}
// vertical alignment
- if (flags & ChromeCanvas::TEXT_VALIGN_TOP)
+ if (flags & gfx::Canvas::TEXT_VALIGN_TOP)
f |= DT_TOP;
- else if (flags & ChromeCanvas::TEXT_VALIGN_BOTTOM)
+ else if (flags & gfx::Canvas::TEXT_VALIGN_BOTTOM)
f |= DT_BOTTOM;
else
f |= DT_VCENTER;
// horizontal alignment
- if (flags & ChromeCanvas::TEXT_ALIGN_CENTER)
+ if (flags & gfx::Canvas::TEXT_ALIGN_CENTER)
f |= DT_CENTER;
- else if (flags & ChromeCanvas::TEXT_ALIGN_RIGHT)
+ else if (flags & gfx::Canvas::TEXT_ALIGN_RIGHT)
f |= DT_RIGHT;
else
f |= DT_LEFT;
@@ -117,20 +117,22 @@ int ComputeFormatFlags(int flags, const std::wstring& text) {
} // anonymous namespace
-ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque)
+namespace gfx {
+
+Canvas::Canvas(int width, int height, bool is_opaque)
: skia::PlatformCanvasWin(width, height, is_opaque) {
}
-ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasWin() {
+Canvas::Canvas() : skia::PlatformCanvasWin() {
}
-ChromeCanvas::~ChromeCanvas() {
+Canvas::~Canvas() {
}
// static
-void ChromeCanvas::SizeStringInt(const std::wstring& text,
- const gfx::Font& font,
- int *width, int *height, int flags) {
+void Canvas::SizeStringInt(const std::wstring& text,
+ const gfx::Font& font,
+ int *width, int *height, int flags) {
HDC dc = GetDC(NULL);
HFONT old_font = static_cast<HFONT>(SelectObject(dc, font.hfont()));
RECT b;
@@ -153,9 +155,9 @@ void ChromeCanvas::SizeStringInt(const std::wstring& text,
ReleaseDC(NULL, dc);
}
-void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font,
- const SkColor& color, int x, int y, int w,
- int h, int flags) {
+void Canvas::DrawStringInt(const std::wstring& text, HFONT font,
+ const SkColor& color, int x, int y, int w, int h,
+ int flags) {
if (!IntersectsClipRectInt(x, y, w, h))
return;
@@ -181,10 +183,10 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font,
getTopPlatformDevice().makeOpaque(x, y, w, h);
}
-void ChromeCanvas::DrawStringInt(const std::wstring& text,
- const gfx::Font& font,
- const SkColor& color,
- int x, int y, int w, int h, int flags) {
+void Canvas::DrawStringInt(const std::wstring& text,
+ const gfx::Font& font,
+ const SkColor& color,
+ int x, int y, int w, int h, int flags) {
DrawStringInt(text, font.hfont(), color, x, y, w, h, flags);
}
@@ -215,19 +217,19 @@ static bool pixelShouldGetHalo(const SkBitmap& bitmap, int x, int y,
return false;
}
-void ChromeCanvas::DrawStringWithHalo(const std::wstring& text,
- const gfx::Font& font,
- const SkColor& text_color,
- const SkColor& halo_color_in,
- int x, int y, int w, int h,
- int flags) {
+void Canvas::DrawStringWithHalo(const std::wstring& text,
+ const gfx::Font& font,
+ const SkColor& text_color,
+ const SkColor& halo_color_in,
+ int x, int y, int w, int h,
+ int flags) {
// Some callers will have semitransparent halo colors, which we don't handle
// (since the resulting image can have 1-bit transparency only).
SkColor halo_color = halo_color_in | 0xFF000000;
// Create a temporary buffer filled with the halo color. It must leave room
// for the 1-pixel border around the text.
- ChromeCanvas text_canvas(w + 2, h + 2, true);
+ Canvas text_canvas(w + 2, h + 2, true);
SkPaint bkgnd_paint;
bkgnd_paint.setColor(halo_color);
text_canvas.FillRectInt(0, 0, w + 2, h + 2, bkgnd_paint);
@@ -262,3 +264,5 @@ void ChromeCanvas::DrawStringWithHalo(const std::wstring& text,
// Draw the halo bitmap with blur.
drawBitmap(text_bitmap, SkIntToScalar(x - 1), SkIntToScalar(y - 1));
}
+
+} // namespace gfx
diff --git a/app/gfx/chrome_font.h b/app/gfx/font.h
index a4b14e9..bf759f75 100644
--- a/app/gfx/chrome_font.h
+++ b/app/gfx/font.h
@@ -111,7 +111,7 @@ class Font {
// copied.
static Font CreateFont(HFONT hfont);
- // Returns the handle to the underlying HFONT. This is used by ChromeCanvas to
+ // Returns the handle to the underlying HFONT. This is used by gfx::Canvas to
// draw text.
HFONT hfont() const { return font_ref_->hfont(); }
diff --git a/app/gfx/chrome_font_gtk.cc b/app/gfx/font_gtk.cc
index babeff5..3b78d02 100644
--- a/app/gfx/chrome_font_gtk.cc
+++ b/app/gfx/font_gtk.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_font.h"
+#include "app/gfx/font.h"
#include <fontconfig/fontconfig.h>
#include <gtk/gtk.h>
diff --git a/app/gfx/chrome_font_mac.mm b/app/gfx/font_mac.mm
index 885c3b1..b39ebea 100644
--- a/app/gfx/chrome_font_mac.mm
+++ b/app/gfx/font_mac.mm
@@ -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_font.h"
+#include "app/gfx/font.h"
#include <Cocoa/Cocoa.h>
diff --git a/app/gfx/chrome_font_skia.cc b/app/gfx/font_skia.cc
index 9622a70..0b0b979 100644
--- a/app/gfx/chrome_font_skia.cc
+++ b/app/gfx/font_skia.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_font.h"
+#include "app/gfx/font.h"
#include "base/logging.h"
#include "base/sys_string_conversions.h"
diff --git a/app/gfx/chrome_font_unittest.cc b/app/gfx/font_unittest.cc
index 0bb840b4..3a13e2f6 100644
--- a/app/gfx/chrome_font_unittest.cc
+++ b/app/gfx/font_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_font.h"
+#include "app/gfx/font.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/app/gfx/chrome_font_win.cc b/app/gfx/font_win.cc
index 1cbe500..7323e9c 100644
--- a/app/gfx/chrome_font_win.cc
+++ b/app/gfx/font_win.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_font.h"
+#include "app/gfx/font.h"
#include <windows.h>
#include <math.h>
@@ -13,7 +13,6 @@
#include "base/logging.h"
#include "base/win_util.h"
#include "grit/generated_resources.h"
-#include "grit/locale_settings.h"
namespace gfx {
diff --git a/app/gfx/icon_util.h b/app/gfx/icon_util.h
index 9066df9..f7199ea 100644
--- a/app/gfx/icon_util.h
+++ b/app/gfx/icon_util.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_ICON_UTIL_H__
-#define CHROME_COMMON_ICON_UTIL_H__
+#ifndef APP_ICON_UTIL_H_
+#define APP_ICON_UTIL_H_
#include <windows.h>
#include <string>
@@ -190,4 +190,4 @@ class IconUtil {
DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil);
};
-#endif // CHROME_COMMON_ICON_UTIL_H__
+#endif // APP_ICON_UTIL_H_
diff --git a/app/gfx/insets.h b/app/gfx/insets.h
index 741de3a2..a90e3a4 100644
--- a/app/gfx/insets.h
+++ b/app/gfx/insets.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_GFX_INSETS_H__
-#define CHROME_COMMON_GFX_INSETS_H__
+#ifndef APP_GFX_INSETS_H_
+#define APP_GFX_INSETS_H_
namespace gfx {
@@ -66,4 +66,4 @@ class Insets {
} // namespace
-#endif // CHROME_COMMON_GFX_INSETS_H__
+#endif // APP_GFX_INSETS_H_
diff --git a/app/gfx/path.h b/app/gfx/path.h
index ac7537c..9c70209 100644
--- a/app/gfx/path.h
+++ b/app/gfx/path.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_GFX_CHROME_PATH_H_
-#define CHROME_COMMON_GFX_CHROME_PATH_H_
+#ifndef APP_GFX_PATH_H_
+#define APP_GFX_PATH_H_
#include "base/basictypes.h"
@@ -37,4 +37,4 @@ class Path : public SkPath {
}
-#endif // #ifndef CHROME_COMMON_GFX_CHROME_PATH_H_
+#endif // #ifndef APP_GFX_PATH_H_
diff --git a/app/gfx/text_elider.cc b/app/gfx/text_elider.cc
index 93653e0..7568aef 100644
--- a/app/gfx/text_elider.cc
+++ b/app/gfx/text_elider.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_font.h"
+#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "base/file_path.h"
#include "base/string_util.h"
diff --git a/app/gfx/text_elider.h b/app/gfx/text_elider.h
index 5872ed4..c0d0be6 100644
--- a/app/gfx/text_elider.h
+++ b/app/gfx/text_elider.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_GFX_TEXT_ELIDER_H_
-#define CHROME_COMMON_GFX_TEXT_ELIDER_H_
+#ifndef APP_GFX_TEXT_ELIDER_H_
+#define APP_GFX_TEXT_ELIDER_H_
#include <unicode/coll.h>
#include <unicode/uchar.h>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/basictypes.h"
#include "base/string16.h"
@@ -96,4 +96,4 @@ class SortedDisplayURL {
} // namespace gfx.
-#endif // CHROME_COMMON_GFX_TEXT_ELIDER_H_
+#endif // APP_GFX_TEXT_ELIDER_H_
diff --git a/app/gfx/text_elider_unittest.cc b/app/gfx/text_elider_unittest.cc
index 28691d7..7887d68 100644
--- a/app/gfx/text_elider_unittest.cc
+++ b/app/gfx/text_elider_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_font.h"
+#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "base/file_path.h"
#include "base/string_util.h"
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index adbef03..611c21a 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -7,7 +7,7 @@
#include "app/l10n_util.h"
#include "app/app_switches.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -611,9 +611,9 @@ void WrapPathWithLTRFormatting(const FilePath& path,
int DefaultCanvasTextAlignment() {
if (GetTextDirection() == LEFT_TO_RIGHT) {
- return ChromeCanvas::TEXT_ALIGN_LEFT;
+ return gfx::Canvas::TEXT_ALIGN_LEFT;
} else {
- return ChromeCanvas::TEXT_ALIGN_RIGHT;
+ return gfx::Canvas::TEXT_ALIGN_RIGHT;
}
}
diff --git a/app/l10n_util.h b/app/l10n_util.h
index aafd658..bbf04eb 100644
--- a/app/l10n_util.h
+++ b/app/l10n_util.h
@@ -188,12 +188,12 @@ void WrapPathWithLTRFormatting(const FilePath& path,
string16* rtl_safe_path);
// Returns the default text alignment to be used when drawing text on a
-// ChromeCanvas based on the directionality of the system locale language. This
-// function is used by ChromeCanvas::DrawStringInt when the text alignment is
+// gfx::Canvas based on the directionality of the system locale language. This
+// function is used by gfx::Canvas::DrawStringInt when the text alignment is
// not specified.
//
-// This function returns either ChromeCanvas::TEXT_ALIGN_LEFT or
-// ChromeCanvas::TEXT_ALIGN_RIGHT.
+// This function returns either gfx::Canvas::TEXT_ALIGN_LEFT or
+// gfx::Canvas::TEXT_ALIGN_RIGHT.
int DefaultCanvasTextAlignment();
// Compares the two strings using the specified collator.
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index 96bc714..2ee2243 100644
--- a/app/resource_bundle.cc
+++ b/app/resource_bundle.cc
@@ -4,7 +4,7 @@
#include "app/resource_bundle.h"
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/gfx/png_decoder.h"
#include "base/logging.h"
#include "base/string_piece.h"
diff --git a/app/resource_bundle_linux.cc b/app/resource_bundle_linux.cc
index 2d47ae5..6f4b43f 100644
--- a/app/resource_bundle_linux.cc
+++ b/app/resource_bundle_linux.cc
@@ -6,7 +6,7 @@
#include <gtk/gtk.h>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/gfx/gtk_util.h"
#include "app/l10n_util.h"
#include "base/base_paths.h"
diff --git a/app/resource_bundle_mac.mm b/app/resource_bundle_mac.mm
index 710364b..f8aab45 100644
--- a/app/resource_bundle_mac.mm
+++ b/app/resource_bundle_mac.mm
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/base_paths.h"
#include "base/data_pack.h"
diff --git a/app/resource_bundle_win.cc b/app/resource_bundle_win.cc
index f65ee2b..1d0d28f 100644
--- a/app/resource_bundle_win.cc
+++ b/app/resource_bundle_win.cc
@@ -6,7 +6,7 @@
#include <atlbase.h>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/file_util.h"
#include "base/logging.h"
diff --git a/app/win_util.h b/app/win_util.h
index 2b5bdce..19bbba7 100644
--- a/app/win_util.h
+++ b/app/win_util.h
@@ -10,7 +10,7 @@
#include <string>
#include <vector>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/fix_wp64.h"
#include "base/gfx/rect.h"
#include "base/scoped_handle.h"
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index 1dabca1..7a20c71 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -6,7 +6,7 @@
#include <locale>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/os_exchange_data.h"
@@ -2009,7 +2009,7 @@ void AutocompleteEditViewWin::DrawSlashForInsecureScheme(
// Create a canvas as large as |scheme_rect| to do our drawing, and initialize
// it to fully transparent so any antialiasing will look nice when painted
// atop the edit.
- ChromeCanvas canvas(scheme_rect.Width(), scheme_rect.Height(), false);
+ gfx::Canvas canvas(scheme_rect.Width(), scheme_rect.Height(), false);
// TODO (jcampan): This const_cast should not be necessary once the SKIA
// API has been changed to return a non-const bitmap.
(const_cast<SkBitmap&>(canvas.getDevice()->accessBitmap(true))).
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
index 053adcd..3913c79 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
@@ -12,7 +12,7 @@
#include <atlmisc.h>
#include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl.
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index 5301f68..718b76c 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -8,7 +8,7 @@
#include <algorithm>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/resource_bundle.h"
#include "base/basictypes.h"
#include "base/gfx/gtk_util.h"
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_win.cc b/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
index 7450655..8f97718 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
@@ -11,8 +11,8 @@
#include <atlmisc.h>
#include <cmath>
-#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/command_line.h"
@@ -670,7 +670,7 @@ void AutocompletePopupViewWin::DrawEntry(HDC dc,
}
void AutocompletePopupViewWin::DrawStar(HDC dc, int x, int y) const {
- ChromeCanvas canvas(star_->width(), star_->height(), false);
+ gfx::Canvas canvas(star_->width(), star_->height(), false);
// Make the background completely transparent.
canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode);
canvas.DrawBitmapInt(*star_, 0, 0);
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_win.h b/chrome/browser/autocomplete/autocomplete_popup_view_win.h
index bc4e135..fbab53a 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_win.h
@@ -12,7 +12,7 @@
#include <string>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/scoped_ptr.h"
#include "base/win_util.h"
#include "chrome/browser/autocomplete/autocomplete.h"
diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc
index fbb1237..7625f83 100644
--- a/chrome/browser/debugger/debugger_view.cc
+++ b/chrome/browser/debugger/debugger_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/debugger/debugger_view.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -57,7 +57,7 @@ void DebuggerView::ViewHierarchyChanged(bool is_add,
}
}
-void DebuggerView::Paint(ChromeCanvas* canvas) {
+void DebuggerView::Paint(gfx::Canvas* canvas) {
#ifndef NDEBUG
SkPaint paint;
canvas->FillRectInt(SK_ColorCYAN, x(), y(), width(), height());
diff --git a/chrome/browser/debugger/debugger_view.h b/chrome/browser/debugger/debugger_view.h
index f0eba87..b4aa0b5 100644
--- a/chrome/browser/debugger/debugger_view.h
+++ b/chrome/browser/debugger/debugger_view.h
@@ -47,7 +47,7 @@ class DebuggerView : public views::View,
}
virtual gfx::Size GetPreferredSize();
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 111baeb..df3fb82 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -65,7 +65,7 @@ SkBitmap* g_background_16 = NULL;
SkBitmap* g_foreground_32 = NULL;
SkBitmap* g_background_32 = NULL;
-void PaintDownloadProgress(ChromeCanvas* canvas,
+void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
@@ -164,7 +164,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas,
foreground_paint);
}
-void PaintDownloadComplete(ChromeCanvas* canvas,
+void PaintDownloadComplete(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index f3c658f..f187706 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -10,7 +10,7 @@
#include <set>
#include <string>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/basictypes.h"
#include "base/task.h"
@@ -97,7 +97,7 @@ enum PaintDownloadProgressSize {
// require the containing View in addition to the canvas because if we are
// drawing in a right-to-left locale, we need to mirror the position of the
// progress animation within the containing View.
-void PaintDownloadProgress(ChromeCanvas* canvas,
+void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
@@ -107,7 +107,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas,
int percent,
PaintDownloadProgressSize size);
-void PaintDownloadComplete(ChromeCanvas* canvas,
+void PaintDownloadComplete(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
diff --git a/chrome/browser/extensions/extension_shelf.cc b/chrome/browser/extensions/extension_shelf.cc
index 934797a..6b765d8 100644
--- a/chrome/browser/extensions/extension_shelf.cc
+++ b/chrome/browser/extensions/extension_shelf.cc
@@ -68,7 +68,7 @@ ExtensionShelf::~ExtensionShelf() {
NotificationService::AllSources());
}
-void ExtensionShelf::Paint(ChromeCanvas* canvas) {
+void ExtensionShelf::Paint(gfx::Canvas* canvas) {
#if 0
// TODO(erikkay) re-enable this when Glen has the gradient values worked out.
SkPaint paint;
@@ -180,7 +180,7 @@ bool ExtensionShelf::HasExtensionViews() {
return GetChildViewCount() > 0;
}
-void ExtensionShelf::InitBackground(ChromeCanvas* canvas,
+void ExtensionShelf::InitBackground(gfx::Canvas* canvas,
const SkRect& subset) {
if (!background_.empty())
return;
diff --git a/chrome/browser/extensions/extension_shelf.h b/chrome/browser/extensions/extension_shelf.h
index b314199..ccfa745 100644
--- a/chrome/browser/extensions/extension_shelf.h
+++ b/chrome/browser/extensions/extension_shelf.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SHELF_H_
#include "chrome/browser/extensions/extensions_service.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "chrome/common/notification_observer.h"
#include "views/view.h"
@@ -19,7 +19,7 @@ class ExtensionShelf : public views::View,
virtual ~ExtensionShelf();
// View
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual void Layout();
@@ -37,7 +37,7 @@ class ExtensionShelf : public views::View,
private:
// Inits the background bitmap.
- void InitBackground(ChromeCanvas* canvas, const SkRect& subset);
+ void InitBackground(gfx::Canvas* canvas, const SkRect& subset);
Browser* browser_;
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc
index 588af8a..2a3f926 100644
--- a/chrome/browser/gtk/download_item_gtk.cc
+++ b/chrome/browser/gtk/download_item_gtk.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/gtk/download_item_gtk.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/text_elider.h"
#include "app/slide_animation.h"
#include "base/basictypes.h"
@@ -402,7 +402,7 @@ gboolean DownloadItemGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget,
GdkEventExpose* event, DownloadItemGtk* download_item) {
// Create a transparent canvas.
- ChromeCanvasPaint canvas(event, false);
+ gfx::CanvasPaint canvas(event, false);
if (download_item->complete_animation_.get()) {
if (download_item->complete_animation_->IsAnimating()) {
download_util::PaintDownloadComplete(&canvas,
diff --git a/chrome/browser/gtk/sad_tab_gtk.cc b/chrome/browser/gtk/sad_tab_gtk.cc
index 912988a..546cc9e 100644
--- a/chrome/browser/gtk/sad_tab_gtk.cc
+++ b/chrome/browser/gtk/sad_tab_gtk.cc
@@ -6,8 +6,8 @@
#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/resource_bundle.h"
#include "base/gfx/size.h"
@@ -80,7 +80,7 @@ gboolean SadTabGtk::OnExposeThunk(GtkWidget* widget,
}
gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
- ChromeCanvasPaint canvas(event);
+ gfx::CanvasPaint canvas(event);
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0, height_,
kBackgroundColor,
@@ -107,7 +107,7 @@ gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
title_y_,
width_,
sad_tab_constants.title_font.height(),
- ChromeCanvas::TEXT_ALIGN_CENTER);
+ gfx::Canvas::TEXT_ALIGN_CENTER);
// Paint the explanatory message.
canvas.DrawStringInt(
@@ -118,9 +118,9 @@ gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
message_y_,
width_,
99999, // Let the height be large, and we'll clip if needed.
- ChromeCanvas::TEXT_ALIGN_CENTER |
- ChromeCanvas::MULTI_LINE |
- ChromeCanvas::TEXT_VALIGN_TOP);
+ gfx::Canvas::TEXT_ALIGN_CENTER |
+ gfx::Canvas::MULTI_LINE |
+ gfx::Canvas::TEXT_VALIGN_TOP);
return TRUE;
}
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
index 5584b3a..371aa40 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
@@ -284,7 +284,7 @@ void TabRendererGtk::AnimationEnded(const Animation* animation) {
// TabRendererGtk, private:
void TabRendererGtk::Paint(GdkEventExpose* event) {
- ChromeCanvasPaint canvas(event, false);
+ gfx::CanvasPaint canvas(event, false);
if (canvas.isEmpty())
return;
@@ -406,7 +406,7 @@ void TabRendererGtk::Layout() {
// TODO(jhawkins): Handle RTL layout.
}
-void TabRendererGtk::PaintTabBackground(ChromeCanvasPaint* canvas) {
+void TabRendererGtk::PaintTabBackground(gfx::CanvasPaint* canvas) {
if (IsSelected()) {
// Sometimes detaching a tab quickly can result in the model reporting it
// as not being selected, so is_drag_clone_ ensures that we always paint
@@ -435,7 +435,7 @@ void TabRendererGtk::PaintTabBackground(ChromeCanvasPaint* canvas) {
}
}
-void TabRendererGtk::PaintInactiveTabBackground(ChromeCanvasPaint* canvas) {
+void TabRendererGtk::PaintInactiveTabBackground(gfx::CanvasPaint* canvas) {
bool is_otr = data_.off_the_record;
// The tab image needs to be lined up with the background image
@@ -486,7 +486,7 @@ void TabRendererGtk::PaintInactiveTabBackground(ChromeCanvasPaint* canvas) {
bounds_.x() + width() - tab_inactive_.r_width, bounds_.y());
}
-void TabRendererGtk::PaintActiveTabBackground(ChromeCanvasPaint* canvas) {
+void TabRendererGtk::PaintActiveTabBackground(gfx::CanvasPaint* canvas) {
int offset = 1;
SkBitmap* tab_bg = theme_provider_->GetBitmapNamed(IDR_THEME_TOOLBAR);
@@ -522,7 +522,7 @@ void TabRendererGtk::PaintActiveTabBackground(ChromeCanvasPaint* canvas) {
bounds_.x() + width() - tab_active_.r_width, bounds_.y());
}
-void TabRendererGtk::PaintLoadingAnimation(ChromeCanvasPaint* canvas) {
+void TabRendererGtk::PaintLoadingAnimation(gfx::CanvasPaint* canvas) {
const SkBitmap* frames =
(loading_animation_.animation_state() == ANIMATION_WAITING) ?
loading_animation_.waiting_animation_frames() :
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
index 15b620f..ef3a9b4 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
@@ -8,8 +8,8 @@
#include <gtk/gtk.h>
#include "app/animation.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/slide_animation.h"
#include "base/basictypes.h"
#include "base/gfx/rect.h"
@@ -171,10 +171,10 @@ class TabRendererGtk : public AnimationDelegate {
static int GetContentHeight();
// Paint various portions of the Tab
- void PaintTabBackground(ChromeCanvasPaint* canvas);
- void PaintInactiveTabBackground(ChromeCanvasPaint* canvas);
- void PaintActiveTabBackground(ChromeCanvasPaint* canvas);
- void PaintLoadingAnimation(ChromeCanvasPaint* canvas);
+ void PaintTabBackground(gfx::CanvasPaint* canvas);
+ void PaintInactiveTabBackground(gfx::CanvasPaint* canvas);
+ void PaintActiveTabBackground(gfx::CanvasPaint* canvas);
+ void PaintLoadingAnimation(gfx::CanvasPaint* canvas);
// Returns the number of favicon-size elements that can fit in the tab's
// current size.
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index cc07a98..4e49e2f 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
@@ -1060,7 +1060,7 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) {
}
void TabStripGtk::PaintBackground(GdkEventExpose* event) {
- ChromeCanvasPaint canvas(event);
+ gfx::CanvasPaint canvas(event);
canvas.TileImageInt(*background, 0, 0, bounds_.width(), bounds_.height());
}
diff --git a/chrome/browser/printing/printed_document.cc b/chrome/browser/printing/printed_document.cc
index f3fb5af..6b01244 100644
--- a/chrome/browser/printing/printed_document.cc
+++ b/chrome/browser/printing/printed_document.cc
@@ -6,7 +6,7 @@
#include <set>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "app/win_util.h"
#include "base/message_loop.h"
diff --git a/chrome/browser/renderer_host/render_widget_host_unittest.cc b/chrome/browser/renderer_host/render_widget_host_unittest.cc
index 1d0c205..419fccf 100644
--- a/chrome/browser/renderer_host/render_widget_host_unittest.cc
+++ b/chrome/browser/renderer_host/render_widget_host_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 "base/basictypes.h"
#include "base/keyboard_codes.h"
#include "base/scoped_ptr.h"
@@ -253,7 +253,7 @@ TEST_F(RenderWidgetHostTest, Background) {
host_->set_view(view.get());
// Create a checkerboard background to test with.
- ChromeCanvas canvas(4, 4, true);
+ gfx::Canvas canvas(4, 4, true);
canvas.FillRectInt(SK_ColorBLACK, 0, 0, 2, 2);
canvas.FillRectInt(SK_ColorWHITE, 2, 0, 2, 2);
canvas.FillRectInt(SK_ColorWHITE, 0, 2, 2, 2);
@@ -288,7 +288,7 @@ TEST_F(RenderWidgetHostTest, Background) {
#endif
#else
- // TODO(port): Mac does not have ChromeCanvas. Maybe we can just change this
+ // TODO(port): Mac does not have gfx::Canvas. Maybe we can just change this
// test to use SkCanvas directly?
#endif
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 2252c8d..82d95f1c 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/resource_bundle.h"
@@ -549,7 +549,7 @@ void RenderWidgetHostViewWin::DrawResizeCorner(const gfx::Rect& paint_rect,
if (!paint_rect.Intersect(resize_corner_rect).IsEmpty()) {
SkBitmap* bitmap = ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_TEXTAREA_RESIZER);
- ChromeCanvas canvas(bitmap->width(), bitmap->height(), false);
+ gfx::Canvas canvas(bitmap->width(), bitmap->height(), false);
// TODO(jcampan): This const_cast should not be necessary once the
// SKIA API has been changed to return a non-const bitmap.
const_cast<SkBitmap&>(canvas.getDevice()->accessBitmap(true)).
@@ -757,9 +757,9 @@ void RenderWidgetHostViewWin::OnPaint(HDC dc) {
void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
CPaintDC* dc) {
if (!background_.empty()) {
- ChromeCanvas canvas(dirty_rect.right - dirty_rect.left,
- dirty_rect.bottom - dirty_rect.top,
- true); // opaque
+ gfx::Canvas canvas(dirty_rect.right - dirty_rect.left,
+ dirty_rect.bottom - dirty_rect.top,
+ true); // opaque
canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top);
const RECT& dc_rect = dc->m_ps.rcPaint;
diff --git a/chrome/browser/tab_contents/tab_contents_view_win.cc b/chrome/browser/tab_contents/tab_contents_view_win.cc
index 887857e..f254820 100644
--- a/chrome/browser/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_win.cc
@@ -6,7 +6,7 @@
#include <windows.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/os_exchange_data.h"
#include "chrome/browser/bookmarks/bookmark_drag_data.h"
#include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
@@ -443,7 +443,7 @@ void TabContentsViewWin::OnPaint(HDC junk_dc) {
CRect cr;
GetClientRect(&cr);
sad_tab_->SetBounds(gfx::Rect(cr));
- ChromeCanvasPaint canvas(GetNativeView(), true);
+ gfx::CanvasPaint canvas(GetNativeView(), true);
sad_tab_->ProcessPaint(&canvas);
return;
}
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index 1468a24..02b5175 100644
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -6,7 +6,7 @@
#include <commdlg.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/resource_bundle.h"
@@ -351,7 +351,7 @@ void AboutChromeView::Layout() {
}
-void AboutChromeView::Paint(ChromeCanvas* canvas) {
+void AboutChromeView::Paint(gfx::Canvas* canvas) {
views::View::Paint(canvas);
// Draw the background image color (and the separator) across the dialog.
@@ -424,7 +424,7 @@ void AboutChromeView::Paint(ChromeCanvas* canvas) {
main_text_label_height_ = position.height() + font.height();
}
-void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas,
+void AboutChromeView::DrawTextAndPositionUrl(gfx::Canvas* canvas,
const std::wstring& text,
views::Link* link,
gfx::Rect* rect,
@@ -479,7 +479,7 @@ void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas,
}
}
-void AboutChromeView::DrawTextStartingFrom(ChromeCanvas* canvas,
+void AboutChromeView::DrawTextStartingFrom(gfx::Canvas* canvas,
const std::wstring& text,
gfx::Size* position,
const gfx::Rect& bounds,
@@ -492,10 +492,10 @@ void AboutChromeView::DrawTextStartingFrom(ChromeCanvas* canvas,
return;
int flags = (text_direction_is_rtl_ ?
- ChromeCanvas::TEXT_ALIGN_RIGHT :
- ChromeCanvas::TEXT_ALIGN_LEFT) |
- ChromeCanvas::MULTI_LINE |
- ChromeCanvas::HIDE_PREFIX;
+ gfx::Canvas::TEXT_ALIGN_RIGHT :
+ gfx::Canvas::TEXT_ALIGN_LEFT) |
+ gfx::Canvas::MULTI_LINE |
+ gfx::Canvas::HIDE_PREFIX;
// Iterate over each word in the text, or put in a more locale-neutral way:
// iterate to the next line breaking opportunity.
diff --git a/chrome/browser/views/about_chrome_view.h b/chrome/browser/views/about_chrome_view.h
index 8b87624..64438bb 100644
--- a/chrome/browser/views/about_chrome_view.h
+++ b/chrome/browser/views/about_chrome_view.h
@@ -41,7 +41,7 @@ class AboutChromeView : public views::View,
// Overridden from views::View:
virtual gfx::Size GetPreferredSize();
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
@@ -93,7 +93,7 @@ class AboutChromeView : public views::View,
// NOTE: The reason why we need this function is because while Skia knows how
// to wrap text appropriately, it doesn't tell us where it drew the last
// character, which we need to position the URLs within the text.
- void DrawTextAndPositionUrl(ChromeCanvas* canvas,
+ void DrawTextAndPositionUrl(gfx::Canvas* canvas,
const std::wstring& text,
views::Link* link,
gfx::Rect* rect,
@@ -106,7 +106,7 @@ class AboutChromeView : public views::View,
// |word_for_word| specifies whether to draw the text word for word or wheter
// to treat the text as one blurb (similar to the way url's are treated inside
// RTL text. For details on the other parameters, see DrawTextAndPositionUrl.
- void DrawTextStartingFrom(ChromeCanvas* canvas,
+ void DrawTextStartingFrom(gfx::Canvas* canvas,
const std::wstring& text,
gfx::Size* position,
const gfx::Rect& bounds,
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
index 43f4d98..9443639 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -8,7 +8,7 @@
#include <commctrl.h>
#include <dwmapi.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "app/gfx/insets.h"
#include "app/gfx/path.h"
@@ -71,7 +71,7 @@ class AutocompleteResultView : public views::View {
virtual ~AutocompleteResultView();
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
virtual void OnMouseEntered(const views::MouseEvent& event);
@@ -92,16 +92,16 @@ class AutocompleteResultView : public views::View {
// |classifications|. If |force_dim| is true, ACMatchClassification::DIM is
// added to all of the classifications. Returns the x position to the right
// of the string.
- int DrawString(ChromeCanvas* canvas,
- const std::wstring& text,
- const ACMatchClassifications& classifications,
- bool force_dim,
- int x,
- int y);
+ int DrawString(gfx::Canvas* canvas,
+ const std::wstring& text,
+ const ACMatchClassifications& classifications,
+ bool force_dim,
+ int x,
+ int y);
// Draws an individual sub-fragment with the specified style. Returns the x
// position to the right of the fragment.
- int DrawStringFragment(ChromeCanvas* canvas,
+ int DrawStringFragment(gfx::Canvas* canvas,
const std::wstring& text,
int style,
int x,
@@ -284,7 +284,7 @@ AutocompleteResultView::AutocompleteResultView(
AutocompleteResultView::~AutocompleteResultView() {
}
-void AutocompleteResultView::Paint(ChromeCanvas* canvas) {
+void AutocompleteResultView::Paint(gfx::Canvas* canvas) {
canvas->FillRectInt(GetBackgroundColor(), 0, 0, width(), height());
int x = MirroredLeftPointForRect(icon_bounds_);
@@ -421,7 +421,7 @@ SkBitmap* AutocompleteResultView::GetIcon() const {
}
int AutocompleteResultView::DrawString(
- ChromeCanvas* canvas,
+ gfx::Canvas* canvas,
const std::wstring& text,
const ACMatchClassifications& classifications,
bool force_dim,
@@ -494,7 +494,7 @@ int AutocompleteResultView::DrawString(
}
int AutocompleteResultView::DrawStringFragment(
- ChromeCanvas* canvas,
+ gfx::Canvas* canvas,
const std::wstring& text,
int style,
int x,
@@ -563,7 +563,7 @@ class PopupBorder : public views::Border {
}
// Overridden from views::Border:
- virtual void Paint(const views::View& view, ChromeCanvas* canvas) const;
+ virtual void Paint(const views::View& view, gfx::Canvas* canvas) const;
virtual void GetInsets(gfx::Insets* insets) const;
private:
@@ -592,7 +592,7 @@ SkBitmap* PopupBorder::dropshadow_bottomright_ = NULL;
SkBitmap* PopupBorder::dropshadow_bottom_ = NULL;
SkBitmap* PopupBorder::dropshadow_bottomleft_ = NULL;
-void PopupBorder::Paint(const views::View& view, ChromeCanvas* canvas) const {
+void PopupBorder::Paint(const views::View& view, gfx::Canvas* canvas) const {
int ds_tl_width = dropshadow_topleft_->width();
int ds_tl_height = dropshadow_topleft_->height();
int ds_tr_width = dropshadow_topright_->width();
@@ -767,7 +767,7 @@ void AutocompletePopupContentsView::SetSelectedLine(size_t index,
////////////////////////////////////////////////////////////////////////////////
// AutocompletePopupContentsView, views::View overrides:
-void AutocompletePopupContentsView::PaintChildren(ChromeCanvas* canvas) {
+void AutocompletePopupContentsView::PaintChildren(gfx::Canvas* canvas) {
// We paint our children in an unconventional way.
//
// Because the border of this view creates an anti-aliased round-rect region
@@ -778,7 +778,7 @@ void AutocompletePopupContentsView::PaintChildren(ChromeCanvas* canvas) {
// Instead, we paint all our children into a second canvas and use that as a
// shader to fill a path representing the round-rect clipping region. This
// yields a nice anti-aliased edge.
- ChromeCanvas contents_canvas(width(), height(), true);
+ gfx::Canvas contents_canvas(width(), height(), true);
contents_canvas.FillRectInt(kBackgroundColor, 0, 0, width(), height());
View::PaintChildren(&contents_canvas);
// We want the contents background to be slightly transparent so we can see
@@ -865,7 +865,7 @@ void AutocompletePopupContentsView::UpdateBlurRegion() {
}
void AutocompletePopupContentsView::MakeCanvasTransparent(
- ChromeCanvas* canvas) {
+ gfx::Canvas* canvas) {
// Allow the window blur effect to show through the popup background.
SkPaint paint;
SkColor transparency = win_util::ShouldUseVistaFrame() ?
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
index 85cecbf..e5d4bc2 100644
--- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
+++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
#define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
@@ -77,7 +77,7 @@ class AutocompletePopupContentsView : public views::View,
virtual void SetSelectedLine(size_t index, bool revert_to_default);
// Overridden from views::View:
- virtual void PaintChildren(ChromeCanvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas);
virtual void Layout();
private:
@@ -89,7 +89,7 @@ class AutocompletePopupContentsView : public views::View,
void UpdateBlurRegion();
// Makes the contents of the canvas slightly transparent.
- void MakeCanvasTransparent(ChromeCanvas* canvas);
+ void MakeCanvasTransparent(gfx::Canvas* canvas);
// The popup that contains this view.
AutocompletePopupWin* popup_;
diff --git a/chrome/browser/views/blocked_popup_container.cc b/chrome/browser/views/blocked_popup_container.cc
index b94adb1..fba9780 100644
--- a/chrome/browser/views/blocked_popup_container.cc
+++ b/chrome/browser/views/blocked_popup_container.cc
@@ -12,7 +12,7 @@
#include <math.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -125,7 +125,7 @@ void BlockedPopupContainerView::UpdateLabel() {
SchedulePaint();
}
-void BlockedPopupContainerView::Paint(ChromeCanvas* canvas) {
+void BlockedPopupContainerView::Paint(gfx::Canvas* canvas) {
// Draw the standard background.
View::Paint(canvas);
diff --git a/chrome/browser/views/blocked_popup_container.h b/chrome/browser/views/blocked_popup_container.h
index dcf7d8f..291b0ee 100644
--- a/chrome/browser/views/blocked_popup_container.h
+++ b/chrome/browser/views/blocked_popup_container.h
@@ -52,7 +52,7 @@ class BlockedPopupContainerView : public views::View,
// Overridden from views::View:
// Paints our border and background. (Does not paint children.)
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// Sets positions of all child views.
virtual void Layout();
// Gets the desired size of the popup notification.
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 1d552dd..d219f9e 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -6,7 +6,7 @@
#include <limits>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
@@ -256,7 +256,7 @@ class BookmarkFolderButton : public views::MenuButton {
return e.IsMiddleMouseButton();
}
- virtual void Paint(ChromeCanvas *canvas) {
+ virtual void Paint(gfx::Canvas *canvas) {
views::MenuButton::Paint(canvas, false);
}
@@ -310,7 +310,7 @@ class ButtonSeparatorView : public views::View {
ButtonSeparatorView() {}
virtual ~ButtonSeparatorView() {}
- virtual void Paint(ChromeCanvas* canvas) {
+ virtual void Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0,
height() / 2,
@@ -554,7 +554,7 @@ void BookmarkBarView::ViewHierarchyChanged(bool is_add,
}
}
-void BookmarkBarView::Paint(ChromeCanvas* canvas) {
+void BookmarkBarView::Paint(gfx::Canvas* canvas) {
if (IsDetachedStyle()) {
// Draw the background to match the new tab page.
canvas->FillRectInt(kNewtabBackgroundColor, 0, 0, width(), height());
@@ -616,7 +616,7 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
}
}
-void BookmarkBarView::PaintChildren(ChromeCanvas* canvas) {
+void BookmarkBarView::PaintChildren(gfx::Canvas* canvas) {
View::PaintChildren(canvas);
if (drop_info_.get() && drop_info_->valid &&
@@ -892,7 +892,7 @@ MenuButton* BookmarkBarView::CreateOverflowButton() {
// right-to-left.
//
// By default, menu buttons are not flipped because they generally contain
- // text and flipping the ChromeCanvas object will break text rendering. Since
+ // text and flipping the gfx::Canvas object will break text rendering. Since
// the overflow button does not contain text, we can safely flip it.
button->EnableCanvasFlippingForRTLUI(true);
@@ -1053,7 +1053,7 @@ void BookmarkBarView::WriteDragData(View* sender,
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
views::TextButton* button = GetBookmarkButton(i);
- ChromeCanvas canvas(button->width(), button->height(), false);
+ gfx::Canvas canvas(button->width(), button->height(), false);
button->Paint(&canvas, true);
drag_utils::SetDragImageOnDataObject(canvas, button->width(),
button->height(), press_x,
diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h
index 1986d2f..6e423a2 100644
--- a/chrome/browser/views/bookmark_bar_view.h
+++ b/chrome/browser/views/bookmark_bar_view.h
@@ -96,8 +96,8 @@ class BookmarkBarView : public views::View,
virtual void DidChangeBounds(const gfx::Rect& previous,
const gfx::Rect& current);
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
- virtual void Paint(ChromeCanvas* canvas);
- virtual void PaintChildren(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas);
virtual bool CanDrop(const OSExchangeData& data);
virtual void OnDragEntered(const views::DropTargetEvent& event);
virtual int OnDragUpdated(const views::DropTargetEvent& event);
diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc
index e24665c..71fd4f1 100644
--- a/chrome/browser/views/bookmark_bubble_view.cc
+++ b/chrome/browser/views/bookmark_bubble_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/bookmark_bubble_view.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "chrome/app/chrome_dll_resource.h"
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index b627bf2..8a0b019 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "base/thread.h"
#include "chrome/browser/bookmarks/bookmark_folder_tree_model.h"
@@ -302,7 +302,7 @@ std::vector<BookmarkNode*> BookmarkManagerView::GetSelectedTableNodes() {
return nodes;
}
-void BookmarkManagerView::PaintBackground(ChromeCanvas* canvas) {
+void BookmarkManagerView::PaintBackground(gfx::Canvas* canvas) {
canvas->drawColor(kBackgroundColorBottom, SkPorterDuff::kSrc_Mode);
SkPaint paint;
diff --git a/chrome/browser/views/bookmark_manager_view.h b/chrome/browser/views/bookmark_manager_view.h
index 33566a4..9c17571 100644
--- a/chrome/browser/views/bookmark_manager_view.h
+++ b/chrome/browser/views/bookmark_manager_view.h
@@ -76,7 +76,7 @@ class BookmarkManagerView : public views::View,
// Returns the selection of the table.
std::vector<BookmarkNode*> GetSelectedTableNodes();
- virtual void PaintBackground(ChromeCanvas* canvas);
+ virtual void PaintBackground(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
diff --git a/chrome/browser/views/bookmark_table_view.cc b/chrome/browser/views/bookmark_table_view.cc
index 5c2c787..a0236bf 100644
--- a/chrome/browser/views/bookmark_table_view.cc
+++ b/chrome/browser/views/bookmark_table_view.cc
@@ -7,8 +7,8 @@
#include <commctrl.h>
#include "app/drag_drop_types.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/os_exchange_data.h"
#include "app/resource_bundle.h"
#include "base/base_drag_source.h"
@@ -420,7 +420,7 @@ void BookmarkTableView::PaintAltText() {
HDC dc = GetDC(GetNativeControlHWND());
gfx::Font font = GetAltTextFont();
gfx::Rect bounds = GetAltTextBounds();
- ChromeCanvas canvas(bounds.width(), bounds.height(), false);
+ gfx::Canvas canvas(bounds.width(), bounds.height(), false);
// Pad by 1 for halo.
canvas.DrawStringWithHalo(alt_text_, font, SK_ColorDKGRAY, SK_ColorWHITE, 1,
1, bounds.width() - 2, bounds.height() - 2,
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc
index 695d450..7b531c6 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_impl.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/views/constrained_window_impl.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/path.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
@@ -177,7 +177,7 @@ class ConstrainedWindowFrameView
virtual void ResetWindowControls() { }
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual void ThemeChanged();
@@ -203,9 +203,9 @@ class ConstrainedWindowFrameView
int* title_thickness) const;
// Paints different parts of the window to the incoming canvas.
- void PaintFrameBorder(ChromeCanvas* canvas);
- void PaintTitleBar(ChromeCanvas* canvas);
- void PaintClientEdge(ChromeCanvas* canvas);
+ void PaintFrameBorder(gfx::Canvas* canvas);
+ void PaintTitleBar(gfx::Canvas* canvas);
+ void PaintClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutWindowControls();
@@ -381,7 +381,7 @@ void ConstrainedWindowFrameView::EnableClose(bool enable) {
////////////////////////////////////////////////////////////////////////////////
// ConstrainedWindowFrameView, views::View implementation:
-void ConstrainedWindowFrameView::Paint(ChromeCanvas* canvas) {
+void ConstrainedWindowFrameView::Paint(gfx::Canvas* canvas) {
PaintFrameBorder(canvas);
PaintTitleBar(canvas);
PaintClientEdge(canvas);
@@ -435,7 +435,7 @@ int ConstrainedWindowFrameView::TitleCoordinates(
return *title_top_spacing + *title_thickness + title_bottom_spacing;
}
-void ConstrainedWindowFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
+void ConstrainedWindowFrameView::PaintFrameBorder(gfx::Canvas* canvas) {
SkBitmap* top_left_corner = resources_->GetPartBitmap(FRAME_TOP_LEFT_CORNER);
SkBitmap* top_right_corner =
resources_->GetPartBitmap(FRAME_TOP_RIGHT_CORNER);
@@ -502,13 +502,13 @@ void ConstrainedWindowFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
height() - top_left_corner->height() - bottom_left_corner->height());
}
-void ConstrainedWindowFrameView::PaintTitleBar(ChromeCanvas* canvas) {
+void ConstrainedWindowFrameView::PaintTitleBar(gfx::Canvas* canvas) {
canvas->DrawStringInt(container_->GetWindowTitle(), *title_font_,
GetTitleColor(), MirroredLeftPointForRect(title_bounds_),
title_bounds_.y(), title_bounds_.width(), title_bounds_.height());
}
-void ConstrainedWindowFrameView::PaintClientEdge(ChromeCanvas* canvas) {
+void ConstrainedWindowFrameView::PaintClientEdge(gfx::Canvas* canvas) {
gfx::Rect client_edge_bounds(CalculateClientAreaBounds(width(), height()));
client_edge_bounds.Inset(-kClientEdgeThickness, -kClientEdgeThickness);
gfx::Rect frame_shadow_bounds(client_edge_bounds);
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc
index 1e9554f..138158e 100644
--- a/chrome/browser/views/download_item_view.cc
+++ b/chrome/browser/views/download_item_view.cc
@@ -6,7 +6,7 @@
#include <vector>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -429,7 +429,7 @@ void DownloadItemView::ButtonPressed(views::Button* sender) {
// Load an icon for the file type we're downloading, and animate any in progress
// download state.
-void DownloadItemView::Paint(ChromeCanvas* canvas) {
+void DownloadItemView::Paint(gfx::Canvas* canvas) {
BodyImageSet* body_image_set;
switch (body_state_) {
case NORMAL:
@@ -624,7 +624,7 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) {
}
}
-void DownloadItemView::PaintBitmaps(ChromeCanvas* canvas,
+void DownloadItemView::PaintBitmaps(gfx::Canvas* canvas,
const SkBitmap* top_bitmap,
const SkBitmap* center_bitmap,
const SkBitmap* bottom_bitmap,
diff --git a/chrome/browser/views/download_item_view.h b/chrome/browser/views/download_item_view.h
index f81242f..1332e1b 100644
--- a/chrome/browser/views/download_item_view.h
+++ b/chrome/browser/views/download_item_view.h
@@ -18,7 +18,7 @@
#include <string>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/slide_animation.h"
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
@@ -55,7 +55,7 @@ class DownloadItemView : public views::ButtonListener,
// View overrides
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual void OnMouseExited(const views::MouseEvent& event);
virtual void OnMouseMoved(const views::MouseEvent& event);
@@ -111,7 +111,7 @@ class DownloadItemView : public views::ButtonListener,
// Convenience method to paint the 3 vertical bitmaps (bottom, middle, top)
// that form the background.
- void PaintBitmaps(ChromeCanvas* canvas,
+ void PaintBitmaps(gfx::Canvas* canvas,
const SkBitmap* top_bitmap,
const SkBitmap* center_bitmap,
const SkBitmap* bottom_bitmap,
diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc
index e2fd9f6..40d6520 100644
--- a/chrome/browser/views/download_shelf_view.cc
+++ b/chrome/browser/views/download_shelf_view.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
@@ -147,12 +147,12 @@ void DownloadShelfView::RemoveDownloadView(View* view) {
SchedulePaint();
}
-void DownloadShelfView::Paint(ChromeCanvas* canvas) {
+void DownloadShelfView::Paint(gfx::Canvas* canvas) {
PaintBackground(canvas);
PaintBorder(canvas);
}
-void DownloadShelfView::PaintBorder(ChromeCanvas* canvas) {
+void DownloadShelfView::PaintBorder(gfx::Canvas* canvas) {
canvas->FillRectInt(kBorderColor, 0, 0, width(), 1);
}
diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h
index 325439f..af3fd59 100644
--- a/chrome/browser/views/download_shelf_view.h
+++ b/chrome/browser/views/download_shelf_view.h
@@ -38,7 +38,7 @@ class DownloadShelfView : public DownloadShelf,
// Implementation of View.
virtual gfx::Size GetPreferredSize();
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// Implementation of AnimationDelegate.
virtual void AnimationProgressed(const Animation* animation);
@@ -70,7 +70,7 @@ class DownloadShelfView : public DownloadShelf,
void AddDownloadView(views::View* view);
// Paints the border.
- void PaintBorder(ChromeCanvas* canvas);
+ void PaintBorder(gfx::Canvas* canvas);
// The animation for adding new items to the shelf.
scoped_ptr<SlideAnimation> new_item_animation_;
diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc
index aa640a5..ededa28 100644
--- a/chrome/browser/views/find_bar_view.cc
+++ b/chrome/browser/views/find_bar_view.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_util.h"
@@ -237,7 +237,7 @@ void FindBarView::SetFocusAndSelection() {
///////////////////////////////////////////////////////////////////////////////
// FindBarView, views::View overrides:
-void FindBarView::Paint(ChromeCanvas* canvas) {
+void FindBarView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
// Get the local bounds so that we now how much to stretch the background.
diff --git a/chrome/browser/views/find_bar_view.h b/chrome/browser/views/find_bar_view.h
index b87ffe1..e56af0e 100644
--- a/chrome/browser/views/find_bar_view.h
+++ b/chrome/browser/views/find_bar_view.h
@@ -56,7 +56,7 @@ class FindBarView : public views::View,
void animation_offset(int offset) { animation_offset_ = offset; }
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 1af097f..4adacf9 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/views/frame/browser_view.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/os_exchange_data.h"
#include "app/resource_bundle.h"
@@ -138,7 +138,7 @@ class ResizeCorner : public views::View {
public:
ResizeCorner() { }
- virtual void Paint(ChromeCanvas* canvas) {
+ virtual void Paint(gfx::Canvas* canvas) {
views::WindowWin* window = GetWindow();
if (!window || (window->IsMaximized() || window->IsFullscreen()))
return;
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index 6eaf547..c314a9e 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/frame/glass_browser_frame_view.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
#include "chrome/browser/browser_theme_provider.h"
@@ -176,7 +176,7 @@ int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) {
///////////////////////////////////////////////////////////////////////////////
// GlassBrowserFrameView, views::View overrides:
-void GlassBrowserFrameView::Paint(ChromeCanvas* canvas) {
+void GlassBrowserFrameView::Paint(gfx::Canvas* canvas) {
if (!browser_view_->IsTabStripVisible())
return; // Nothing is visible, so don't bother to paint.
@@ -216,7 +216,7 @@ int GlassBrowserFrameView::NonClientTopBorderHeight() const {
(browser_view_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness);
}
-void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
+void GlassBrowserFrameView::PaintDistributorLogo(gfx::Canvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
if (!frame_->IsMaximized() && distributor_logo_ &&
@@ -229,7 +229,7 @@ void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
}
}
-void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
+void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds());
@@ -261,7 +261,7 @@ void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
toolbar_bounds.right(), toolbar_bounds.y());
}
-void GlassBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
+void GlassBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) {
if (!browser_view_->ShouldShowOffTheRecordAvatar())
return;
@@ -273,7 +273,7 @@ void GlassBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false);
}
-void GlassBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
+void GlassBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
// The client edges start below the toolbar upper corner images regardless
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.h b/chrome/browser/views/frame/glass_browser_frame_view.h
index 3a00db3..7b999e1 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.h
+++ b/chrome/browser/views/frame/glass_browser_frame_view.h
@@ -34,7 +34,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView {
protected:
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
private:
@@ -51,10 +51,10 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView {
int NonClientTopBorderHeight() const;
// Paint various sub-components of this view.
- void PaintDistributorLogo(ChromeCanvas* canvas);
- void PaintToolbarBackground(ChromeCanvas* canvas);
- void PaintOTRAvatar(ChromeCanvas* canvas);
- void PaintRestoredClientEdge(ChromeCanvas* canvas);
+ void PaintDistributorLogo(gfx::Canvas* canvas);
+ void PaintToolbarBackground(gfx::Canvas* canvas);
+ void PaintOTRAvatar(gfx::Canvas* canvas);
+ void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutDistributorLogo();
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc
index 89b50f5..29ee9d9 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/views/frame/opaque_browser_frame_view.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/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -313,7 +313,7 @@ void OpaqueBrowserFrameView::ResetWindowControls() {
///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameView, views::View overrides:
-void OpaqueBrowserFrameView::Paint(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::Paint(gfx::Canvas* canvas) {
if (frame_->IsFullscreen())
return; // Nothing is visible, so don't bother to paint.
@@ -506,7 +506,7 @@ int OpaqueBrowserFrameView::IconSize(int* title_top_spacing_ptr,
kIconHeightFractionDenominator) / 2 * 2, kIconMinimumSize);
}
-void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
SkBitmap* top_left_corner = tp->GetBitmapNamed(IDR_WINDOW_TOP_LEFT_CORNER);
@@ -603,7 +603,7 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
}
-void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
// Window frame mode and color
SkBitmap* theme_frame;
@@ -632,7 +632,7 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
}
}
-void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintDistributorLogo(gfx::Canvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
if (!frame_->IsMaximized() && distributor_logo_ &&
@@ -642,7 +642,7 @@ void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
}
}
-void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintTitleBar(gfx::Canvas* canvas) {
// The window icon is painted by the TabIconView.
views::WindowDelegate* d = frame_->GetDelegate();
if (d->ShouldShowWindowTitle()) {
@@ -658,7 +658,7 @@ void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) {
}
}
-void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
if (!browser_view_->IsToolbarVisible())
return;
@@ -716,7 +716,7 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
toolbar_right->width(), bottom_edge_height, false);
}
-void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) {
if (!browser_view_->ShouldShowOffTheRecordAvatar())
return;
@@ -728,7 +728,7 @@ void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false);
}
-void OpaqueBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
+void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
int client_area_top = frame_->GetClientView()->y();
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h
index 6d16a2f..575992b 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.h
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.h
@@ -47,7 +47,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
virtual void ResetWindowControls();
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual bool HitTest(const gfx::Point& l) const;
virtual void ViewHierarchyChanged(bool is_add,
@@ -101,13 +101,13 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
// Paint various sub-components of this view. The *FrameBorder() functions
// also paint the background of the titlebar area, since the top frame border
// and titlebar background are a contiguous component.
- void PaintRestoredFrameBorder(ChromeCanvas* canvas);
- void PaintMaximizedFrameBorder(ChromeCanvas* canvas);
- void PaintDistributorLogo(ChromeCanvas* canvas);
- void PaintTitleBar(ChromeCanvas* canvas);
- void PaintToolbarBackground(ChromeCanvas* canvas);
- void PaintOTRAvatar(ChromeCanvas* canvas);
- void PaintRestoredClientEdge(ChromeCanvas* canvas);
+ void PaintRestoredFrameBorder(gfx::Canvas* canvas);
+ void PaintMaximizedFrameBorder(gfx::Canvas* canvas);
+ void PaintDistributorLogo(gfx::Canvas* canvas);
+ void PaintTitleBar(gfx::Canvas* canvas);
+ void PaintToolbarBackground(gfx::Canvas* canvas);
+ void PaintOTRAvatar(gfx::Canvas* canvas);
+ void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutWindowControls();
diff --git a/chrome/browser/views/fullscreen_exit_bubble.cc b/chrome/browser/views/fullscreen_exit_bubble.cc
index ff491a0..5f61598 100644
--- a/chrome/browser/views/fullscreen_exit_bubble.cc
+++ b/chrome/browser/views/fullscreen_exit_bubble.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/fullscreen_exit_bubble.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/resource_bundle.h"
@@ -29,7 +29,7 @@ class FullscreenExitBubble::FullscreenExitView : public views::View {
// views::View
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// Handle to the HWND that contains us.
views::WidgetWin* popup_;
@@ -71,7 +71,7 @@ void FullscreenExitBubble::FullscreenExitView::Layout() {
link_preferred_size.width(), link_preferred_size.height());
}
-void FullscreenExitBubble::FullscreenExitView::Paint(ChromeCanvas* canvas) {
+void FullscreenExitBubble::FullscreenExitView::Paint(gfx::Canvas* canvas) {
// Create a round-bottomed rect to fill the whole View.
CRect parent_rect;
SkRect rect;
diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc
index 4c1397a..adc08d5 100644
--- a/chrome/browser/views/hung_renderer_view.cc
+++ b/chrome/browser/views/hung_renderer_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/hung_renderer_dialog.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/renderer_host/render_process_host.h"
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index b31a8f6..9447285 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/info_bubble.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/resource_bundle.h"
#include "app/win_util.h"
@@ -338,7 +338,7 @@ HRGN InfoBubble::ContentView::GetMask(const CSize &size) {
return mask.CreateHRGN();
}
-void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) {
+void InfoBubble::ContentView::Paint(gfx::Canvas* canvas) {
int bubble_x = 0;
int bubble_y = 0;
int bubble_w = width();
diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h
index 7368235..2b94ba6 100644
--- a/chrome/browser/views/info_bubble.h
+++ b/chrome/browser/views/info_bubble.h
@@ -121,7 +121,7 @@ class InfoBubble : public views::WidgetWin,
HRGN GetMask(const CSize& size);
// Paints the background and arrow appropriately.
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// Returns true if the arrow is positioned along the top edge of the
// view. If this returns false the arrow is positioned along the bottom
diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc
index f14aded..a687c8f 100644
--- a/chrome/browser/views/infobars/infobars.cc
+++ b/chrome/browser/views/infobars/infobars.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/infobars/infobars.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
@@ -64,7 +64,7 @@ class InfoBarBackground : public views::Background {
}
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas, views::View* view) const {
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
// First paint the gradient background.
gradient_background_->Paint(canvas, view);
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index 3014dfc..415334e 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/location_bar_view.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"
@@ -223,7 +223,7 @@ void LocationBarView::Layout() {
DoLayout(true);
}
-void LocationBarView::Paint(ChromeCanvas* canvas) {
+void LocationBarView::Paint(gfx::Canvas* canvas) {
View::Paint(canvas);
SkColor bg = SkColorSetRGB(
@@ -677,7 +677,7 @@ void LocationBarView::SelectedKeywordView::SetFont(const gfx::Font& font) {
partial_label_.SetFont(font);
}
-void LocationBarView::SelectedKeywordView::Paint(ChromeCanvas* canvas) {
+void LocationBarView::SelectedKeywordView::Paint(gfx::Canvas* canvas) {
canvas->TranslateInt(0, kBackgroundYOffset);
background_painter_.Paint(width(), height() - kTopInset, canvas);
canvas->TranslateInt(0, -kBackgroundYOffset);
@@ -795,7 +795,7 @@ void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) {
}
}
-void LocationBarView::KeywordHintView::Paint(ChromeCanvas* canvas) {
+void LocationBarView::KeywordHintView::Paint(gfx::Canvas* canvas) {
int image_x = leading_label_.IsVisible() ? leading_label_.width() : 0;
// Since we paint the button image directly on the canvas (instead of using a
diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h
index c0b2a9e..b0648d7 100644
--- a/chrome/browser/views/location_bar_view.h
+++ b/chrome/browser/views/location_bar_view.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/gfx/rect.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view_win.h"
@@ -78,10 +78,10 @@ class LocationBarView : public LocationBar,
// Layout and Painting functions
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// No focus border for the location bar, the caret is enough.
- virtual void PaintFocusBorder(ChromeCanvas* canvas) { }
+ virtual void PaintFocusBorder(gfx::Canvas* canvas) { }
// Called when any ancestor changes its size, asks the AutocompleteEditModel
// to close its popup.
@@ -149,7 +149,7 @@ class LocationBarView : public LocationBar,
void SetFont(const gfx::Font& font);
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual gfx::Size GetMinimumSize();
@@ -204,7 +204,7 @@ class LocationBarView : public LocationBar,
void SetKeyword(const std::wstring& keyword);
std::wstring keyword() const { return keyword_; }
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
// The minimum size is just big enough to show the tab.
virtual gfx::Size GetMinimumSize();
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index 587bd71..a1ed601 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -12,7 +12,7 @@
#include <vsstyle.h>
#include <vssym32.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -62,7 +62,7 @@ class ListBackground : public views::Background {
}
virtual ~ListBackground() {}
- virtual void Paint(ChromeCanvas* canvas, views::View* view) const {
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
HDC dc = canvas->beginPlatformPaint();
RECT native_lb = view->GetLocalBounds(true).ToRECT();
gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb);
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc
index ef822ee12..77dd376 100644
--- a/chrome/browser/views/options/content_page_view.cc
+++ b/chrome/browser/views/options/content_page_view.cc
@@ -9,7 +9,7 @@
#include <vsstyle.h>
#include <vssym32.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
@@ -54,7 +54,7 @@ class FileDisplayArea : public views::View {
void SetFile(const FilePath& file_path);
// views::View overrides:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
@@ -104,7 +104,7 @@ void FileDisplayArea::SetFile(const FilePath& file_path) {
}
}
-void FileDisplayArea::Paint(ChromeCanvas* canvas) {
+void FileDisplayArea::Paint(gfx::Canvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc
index a294fff..f937c6d 100644
--- a/chrome/browser/views/options/cookies_view.cc
+++ b/chrome/browser/views/options/cookies_view.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc
index 41cb561..3488d10 100644
--- a/chrome/browser/views/options/fonts_page_view.cc
+++ b/chrome/browser/views/options/fonts_page_view.cc
@@ -11,8 +11,8 @@
#include <vector>
-#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/file_util.h"
@@ -113,7 +113,7 @@ class FontDisplayView : public views::View {
int font_size() { return font_size_; }
// views::View overrides:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
@@ -175,7 +175,7 @@ void FontDisplayView::SetFontType(const std::wstring& font_name,
font_text_label_->SetText(displayed_text);
}
-void FontDisplayView::Paint(ChromeCanvas* canvas) {
+void FontDisplayView::Paint(gfx::Canvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc
index c65474e..c768bd6 100644
--- a/chrome/browser/views/options/languages_page_view.cc
+++ b/chrome/browser/views/options/languages_page_view.cc
@@ -8,8 +8,8 @@
#include "chrome/browser/views/options/languages_page_view.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/file_util.h"
diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc
index a8697ba..73cbf8d 100644
--- a/chrome/browser/views/options/options_group_view.cc
+++ b/chrome/browser/views/options/options_group_view.cc
@@ -7,8 +7,8 @@
#include "chrome/browser/views/options/options_group_view.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"
@@ -62,7 +62,7 @@ int OptionsGroupView::GetContentsWidth() const {
///////////////////////////////////////////////////////////////////////////////
// OptionsGroupView, views::View overrides:
-void OptionsGroupView::Paint(ChromeCanvas* canvas) {
+void OptionsGroupView::Paint(gfx::Canvas* canvas) {
if (highlighted_) {
COLORREF infocolor = GetSysColor(COLOR_INFOBK);
SkColor background_color = SkColorSetRGB(GetRValue(infocolor),
diff --git a/chrome/browser/views/options/options_group_view.h b/chrome/browser/views/options/options_group_view.h
index 1cabd1d..6d5505a1 100644
--- a/chrome/browser/views/options/options_group_view.h
+++ b/chrome/browser/views/options/options_group_view.h
@@ -34,7 +34,7 @@ class OptionsGroupView : public views::View {
protected:
// views::View overrides:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc
index 61a9e57..2c5ee30 100644
--- a/chrome/browser/views/sad_tab_view.cc
+++ b/chrome/browser/views/sad_tab_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/sad_tab_view.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/gfx/size.h"
@@ -35,7 +35,7 @@ SadTabView::SadTabView() {
InitClass();
}
-void SadTabView::Paint(ChromeCanvas* canvas) {
+void SadTabView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0, height(),
kBackgroundColor,
@@ -50,12 +50,12 @@ void SadTabView::Paint(ChromeCanvas* canvas) {
canvas->DrawStringInt(title_, *title_font_, kTitleColor, title_bounds_.x(),
title_bounds_.y(), title_bounds_.width(),
title_bounds_.height(),
- ChromeCanvas::TEXT_ALIGN_CENTER);
+ gfx::Canvas::TEXT_ALIGN_CENTER);
canvas->DrawStringInt(message_, *message_font_, kMessageColor,
message_bounds_.x(), message_bounds_.y(),
message_bounds_.width(), message_bounds_.height(),
- ChromeCanvas::MULTI_LINE);
+ gfx::Canvas::MULTI_LINE);
}
void SadTabView::Layout() {
@@ -70,11 +70,11 @@ void SadTabView::Layout() {
int title_height = title_font_->height();
title_bounds_.SetRect(title_x, title_y, title_width_, title_height);
- ChromeCanvas cc(0, 0, true);
+ gfx::Canvas cc(0, 0, true);
int message_width = static_cast<int>(width() * kMessageSize);
int message_height = 0;
cc.SizeStringInt(message_, *message_font_, &message_width, &message_height,
- ChromeCanvas::MULTI_LINE);
+ gfx::Canvas::MULTI_LINE);
int message_x = (width() - message_width) / 2;
int message_y = title_bounds_.bottom() + kTitleMessageSpacing;
message_bounds_.SetRect(message_x, message_y, message_width, message_height);
diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h
index 1a279b6..65ed6fb 100644
--- a/chrome/browser/views/sad_tab_view.h
+++ b/chrome/browser/views/sad_tab_view.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
#define CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "base/basictypes.h"
#include "views/view.h"
@@ -32,7 +32,7 @@ class SadTabView : public views::View {
virtual ~SadTabView() {}
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
private:
diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc
index bd5d51f..b476f61 100644
--- a/chrome/browser/views/shell_dialogs_win.cc
+++ b/chrome/browser/views/shell_dialogs_win.cc
@@ -12,7 +12,7 @@
#include <algorithm>
#include <set>
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/win_util.h"
#include "base/file_util.h"
diff --git a/chrome/browser/views/star_toggle.cc b/chrome/browser/views/star_toggle.cc
index 01ab0b3..0e03f91 100644
--- a/chrome/browser/views/star_toggle.cc
+++ b/chrome/browser/views/star_toggle.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/star_toggle.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/app/chrome_dll_resource.h"
#include "grit/theme_resources.h"
@@ -33,7 +33,7 @@ bool StarToggle::GetState() const {
return state_;
}
-void StarToggle::Paint(ChromeCanvas* canvas) {
+void StarToggle::Paint(gfx::Canvas* canvas) {
PaintFocusBorder(canvas);
canvas->DrawBitmapInt(state_ ? *state_on_ : *state_off_,
(width() - state_off_->width()) / 2,
diff --git a/chrome/browser/views/star_toggle.h b/chrome/browser/views/star_toggle.h
index 08d1791..1cfc0de 100644
--- a/chrome/browser/views/star_toggle.h
+++ b/chrome/browser/views/star_toggle.h
@@ -42,7 +42,7 @@ class StarToggle : public views::View {
void SwitchState();
// Overriden from view.
- void Paint(ChromeCanvas* canvas);
+ void Paint(gfx::Canvas* canvas);
gfx::Size GetPreferredSize();
virtual bool OnMousePressed(const views::MouseEvent& e);
virtual bool OnMouseDragged(const views::MouseEvent& event);
diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc
index a0c687e..250614b 100644
--- a/chrome/browser/views/status_bubble_views.cc
+++ b/chrome/browser/views/status_bubble_views.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
@@ -142,7 +142,7 @@ class StatusBubbleViews::StatusView : public views::Label,
void AnimateToState(double state);
void AnimationEnded(const Animation* animation);
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
BubbleStage stage_;
BubbleStyle style_;
@@ -318,7 +318,7 @@ void StatusBubbleViews::StatusView::SetStyle(BubbleStyle style) {
}
}
-void StatusBubbleViews::StatusView::Paint(ChromeCanvas* canvas) {
+void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setFlags(SkPaint::kAntiAlias_Flag);
diff --git a/chrome/browser/views/tab_icon_view.cc b/chrome/browser/views/tab_icon_view.cc
index 578c917..315d310 100644
--- a/chrome/browser/views/tab_icon_view.cc
+++ b/chrome/browser/views/tab_icon_view.cc
@@ -7,7 +7,7 @@
#include <windows.h>
#include <shellapi.h>
-#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/resource_bundle.h"
@@ -83,17 +83,17 @@ void TabIconView::Update() {
}
}
-void TabIconView::PaintThrobber(ChromeCanvas* canvas) {
+void TabIconView::PaintThrobber(gfx::Canvas* canvas) {
int image_size = g_throbber_frames->height();
PaintIcon(canvas, is_light_ ? *g_throbber_frames_light : *g_throbber_frames,
throbber_frame_ * image_size, 0, image_size, image_size, false);
}
-void TabIconView::PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap) {
+void TabIconView::PaintFavIcon(gfx::Canvas* canvas, const SkBitmap& bitmap) {
PaintIcon(canvas, bitmap, 0, 0, bitmap.width(), bitmap.height(), true);
}
-void TabIconView::PaintIcon(ChromeCanvas* canvas,
+void TabIconView::PaintIcon(gfx::Canvas* canvas,
const SkBitmap& bitmap,
int src_x,
int src_y,
@@ -125,7 +125,7 @@ void TabIconView::PaintIcon(ChromeCanvas* canvas,
dest_h, filter);
}
-void TabIconView::Paint(ChromeCanvas* canvas) {
+void TabIconView::Paint(gfx::Canvas* canvas) {
bool rendered = false;
if (throbber_running_) {
diff --git a/chrome/browser/views/tab_icon_view.h b/chrome/browser/views/tab_icon_view.h
index 2860699..d25f4f9 100644
--- a/chrome/browser/views/tab_icon_view.h
+++ b/chrome/browser/views/tab_icon_view.h
@@ -39,13 +39,13 @@ class TabIconView : public views::View {
void set_is_light(bool is_light) { is_light_ = is_light; }
// Overriden from View
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
private:
- void PaintThrobber(ChromeCanvas* canvas);
- void PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap);
- void PaintIcon(ChromeCanvas* canvas,
+ void PaintThrobber(gfx::Canvas* canvas);
+ void PaintFavIcon(gfx::Canvas* canvas, const SkBitmap& bitmap);
+ void PaintIcon(gfx::Canvas* canvas,
const SkBitmap& bitmap,
int src_x,
int src_y,
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index f56a00f..7f37ac4 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -8,7 +8,7 @@
#include <set>
#include "app/animation.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
@@ -51,7 +51,7 @@ class DockView : public views::View {
return gfx::Size(DockInfo::popup_width(), DockInfo::popup_height());
}
- virtual void PaintBackground(ChromeCanvas* canvas) {
+ virtual void PaintBackground(gfx::Canvas* canvas) {
SkRect outer_rect = { SkIntToScalar(0), SkIntToScalar(0),
SkIntToScalar(width()),
SkIntToScalar(height()) };
@@ -118,7 +118,7 @@ class DockView : public views::View {
}
private:
- void DrawBitmapWithAlpha(ChromeCanvas* canvas, const SkBitmap& image,
+ void DrawBitmapWithAlpha(gfx::Canvas* canvas, const SkBitmap& image,
int x, int y) {
SkPaint paint;
paint.setAlpha(128);
diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc
index ae42710..695bcdd 100644
--- a/chrome/browser/views/tabs/dragged_tab_view.cc
+++ b/chrome/browser/views/tabs/dragged_tab_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/tabs/dragged_tab_view.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/views/tabs/hwnd_photobooth.h"
@@ -148,7 +148,7 @@ void DraggedTabView::AnimationCanceled(const Animation* animation) {
///////////////////////////////////////////////////////////////////////////////
// DraggedTabView, views::View overrides:
-void DraggedTabView::Paint(ChromeCanvas* canvas) {
+void DraggedTabView::Paint(gfx::Canvas* canvas) {
if (!show_contents_on_drag_) {
PaintFocusRect(canvas);
} else if (attached_) {
@@ -185,13 +185,13 @@ gfx::Size DraggedTabView::GetPreferredSize() {
////////////////////////////////////////////////////////////////////////////////
// DraggedTabView, private:
-void DraggedTabView::PaintAttachedTab(ChromeCanvas* canvas) {
+void DraggedTabView::PaintAttachedTab(gfx::Canvas* canvas) {
renderer_->ProcessPaint(canvas);
}
-void DraggedTabView::PaintDetachedView(ChromeCanvas* canvas) {
+void DraggedTabView::PaintDetachedView(gfx::Canvas* canvas) {
gfx::Size ps = GetPreferredSize();
- ChromeCanvas scale_canvas(ps.width(), ps.height(), false);
+ gfx::Canvas scale_canvas(ps.width(), ps.height(), false);
SkBitmap& bitmap_device = const_cast<SkBitmap&>(
scale_canvas.getTopPlatformDevice().accessBitmap(true));
bitmap_device.eraseARGB(0, 0, 0, 0);
@@ -236,7 +236,7 @@ void DraggedTabView::PaintDetachedView(ChromeCanvas* canvas) {
canvas->drawRect(rc, paint);
}
-void DraggedTabView::PaintFocusRect(ChromeCanvas* canvas) {
+void DraggedTabView::PaintFocusRect(gfx::Canvas* canvas) {
gfx::Size ps = GetPreferredSize();
canvas->DrawFocusRect(0, 0,
static_cast<int>(ps.width() * kScalingFactor),
diff --git a/chrome/browser/views/tabs/dragged_tab_view.h b/chrome/browser/views/tabs/dragged_tab_view.h
index 1ee9d25..504681b 100644
--- a/chrome/browser/views/tabs/dragged_tab_view.h
+++ b/chrome/browser/views/tabs/dragged_tab_view.h
@@ -59,18 +59,18 @@ class DraggedTabView : public views::View,
virtual void AnimationCanceled(const Animation* animation);
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
// Paint the view, when it's attached to a TabStrip.
- void PaintAttachedTab(ChromeCanvas* canvas);
+ void PaintAttachedTab(gfx::Canvas* canvas);
// Paint the view, when it's not attached to any TabStrip.
- void PaintDetachedView(ChromeCanvas* canvas);
+ void PaintDetachedView(gfx::Canvas* canvas);
// Paint the view, when "Show window contents while dragging" is disabled.
- void PaintFocusRect(ChromeCanvas* canvas);
+ void PaintFocusRect(gfx::Canvas* canvas);
// Resizes the container to fit the content for the current attachment mode.
void ResizeContainer();
diff --git a/chrome/browser/views/tabs/hwnd_photobooth.cc b/chrome/browser/views/tabs/hwnd_photobooth.cc
index 79de995..c51473c 100644
--- a/chrome/browser/views/tabs/hwnd_photobooth.cc
+++ b/chrome/browser/views/tabs/hwnd_photobooth.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 "base/gfx/point.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/tabs/hwnd_photobooth.h"
@@ -78,7 +78,7 @@ void HWNDPhotobooth::ReplaceHWND(HWND new_hwnd) {
}
void HWNDPhotobooth::PaintScreenshotIntoCanvas(
- ChromeCanvas* canvas,
+ gfx::Canvas* canvas,
const gfx::Rect& target_bounds) {
// Our contained window may have been re-parented. Make sure it belongs to
// us until someone calls ReplaceHWND(NULL).
diff --git a/chrome/browser/views/tabs/hwnd_photobooth.h b/chrome/browser/views/tabs/hwnd_photobooth.h
index e621e24..c3ef430 100644
--- a/chrome/browser/views/tabs/hwnd_photobooth.h
+++ b/chrome/browser/views/tabs/hwnd_photobooth.h
@@ -8,7 +8,9 @@
#include "base/basictypes.h"
#include "base/gfx/rect.h"
-class ChromeCanvas;
+namespace gfx {
+class Canvas;
+}
namespace views {
class WidgetWin;
}
@@ -42,7 +44,7 @@ class HWNDPhotobooth {
// Paints the current display image of the window into |canvas|, clipped to
// |target_bounds|.
- void PaintScreenshotIntoCanvas(ChromeCanvas* canvas,
+ void PaintScreenshotIntoCanvas(gfx::Canvas* canvas,
const gfx::Rect& target_bounds);
private:
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index bf606d5..d5aa9a3 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/tabs/tab.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc
index 6954055..c27ece6 100644
--- a/chrome/browser/views/tabs/tab_renderer.cc
+++ b/chrome/browser/views/tabs/tab_renderer.cc
@@ -6,8 +6,8 @@
#include <limits>
-#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 "app/win_util.h"
@@ -367,7 +367,7 @@ std::wstring TabRenderer::GetTitle() const {
////////////////////////////////////////////////////////////////////////////////
// TabRenderer, views::View overrides:
-void TabRenderer::Paint(ChromeCanvas* canvas) {
+void TabRenderer::Paint(gfx::Canvas* canvas) {
// Don't paint if we're narrower than we can render correctly. (This should
// only happen during animations).
if (width() < GetMinimumUnselectedSize().width())
@@ -555,7 +555,7 @@ void TabRenderer::AnimationEnded(const Animation* animation) {
////////////////////////////////////////////////////////////////////////////////
// TabRenderer, private
-void TabRenderer::PaintTabBackground(ChromeCanvas* canvas) {
+void TabRenderer::PaintTabBackground(gfx::Canvas* canvas) {
if (IsSelected()) {
// Sometimes detaching a tab quickly can result in the model reporting it
// as not being selected, so is_drag_clone_ ensures that we always paint
@@ -581,7 +581,7 @@ void TabRenderer::PaintTabBackground(ChromeCanvas* canvas) {
}
}
-void TabRenderer::PaintInactiveTabBackground(ChromeCanvas* canvas) {
+void TabRenderer::PaintInactiveTabBackground(gfx::Canvas* canvas) {
bool is_otr = data_.off_the_record;
// The tab image needs to be lined up with the background image
@@ -638,7 +638,7 @@ void TabRenderer::PaintInactiveTabBackground(ChromeCanvas* canvas) {
width() - tab_inactive.r_width, 0);
}
-void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
+void TabRenderer::PaintActiveTabBackground(gfx::Canvas* canvas) {
int offset = GetX(views::View::APPLY_MIRRORING_TRANSFORMATION) + 1;
ThemeProvider* tp = GetThemeProvider();
if (!tp)
@@ -674,7 +674,7 @@ void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
canvas->DrawBitmapInt(*tab_active.image_r, width() - tab_active.r_width, 0);
}
-void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
+void TabRenderer::PaintHoverTabBackground(gfx::Canvas* canvas,
double opacity) {
bool is_otr = data_.off_the_record;
SkBitmap left = skia::ImageOperations::CreateBlendedBitmap(
@@ -690,7 +690,7 @@ void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
canvas->DrawBitmapInt(right, width() - tab_active.r_width, 0);
}
-void TabRenderer::PaintLoadingAnimation(ChromeCanvas* canvas) {
+void TabRenderer::PaintLoadingAnimation(gfx::Canvas* canvas) {
SkBitmap* frames = (animation_state_ == ANIMATION_WAITING) ?
waiting_animation_frames : loading_animation_frames;
int image_size = frames->height();
diff --git a/chrome/browser/views/tabs/tab_renderer.h b/chrome/browser/views/tabs/tab_renderer.h
index d278fb5..26dc4cd 100644
--- a/chrome/browser/views/tabs/tab_renderer.h
+++ b/chrome/browser/views/tabs/tab_renderer.h
@@ -92,7 +92,7 @@ class TabRenderer : public views::View,
private:
// Overridden from views::View:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual void OnMouseEntered(const views::MouseEvent& event);
virtual void OnMouseExited(const views::MouseEvent& event);
@@ -117,11 +117,11 @@ class TabRenderer : public views::View,
void ResetCrashedFavIcon();
// Paint various portions of the Tab
- void PaintTabBackground(ChromeCanvas* canvas);
- void PaintInactiveTabBackground(ChromeCanvas* canvas);
- void PaintActiveTabBackground(ChromeCanvas* canvas);
- void PaintHoverTabBackground(ChromeCanvas* canvas, double opacity);
- void PaintLoadingAnimation(ChromeCanvas* canvas);
+ void PaintTabBackground(gfx::Canvas* canvas);
+ void PaintInactiveTabBackground(gfx::Canvas* canvas);
+ void PaintActiveTabBackground(gfx::Canvas* canvas);
+ void PaintHoverTabBackground(gfx::Canvas* canvas, double opacity);
+ void PaintLoadingAnimation(gfx::Canvas* canvas);
// Returns the number of favicon-size elements that can fit in the tab's
// current size.
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 7d2a441..2ffcfd6 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/views/tabs/tab_strip.h"
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
@@ -586,7 +586,7 @@ void TabStrip::UpdateLoadingAnimations() {
///////////////////////////////////////////////////////////////////////////////
// TabStrip, views::View overrides:
-void TabStrip::PaintChildren(ChromeCanvas* canvas) {
+void TabStrip::PaintChildren(gfx::Canvas* canvas) {
// Paint the tabs in reverse order, so they stack to the left.
Tab* selected_tab = NULL;
for (int i = GetTabCount() - 1; i >= 0; --i) {
diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h
index 86cd181..2c1cc23 100644
--- a/chrome/browser/views/tabs/tab_strip.h
+++ b/chrome/browser/views/tabs/tab_strip.h
@@ -90,7 +90,7 @@ class TabStrip : public views::View,
void UpdateLoadingAnimations();
// views::View overrides:
- virtual void PaintChildren(ChromeCanvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas);
virtual views::View* GetViewByID(int id) const;
virtual void Layout();
virtual gfx::Size GetPreferredSize();
diff --git a/chrome/browser/views/theme_helpers.cc b/chrome/browser/views/theme_helpers.cc
index af863f8..46b6172 100644
--- a/chrome/browser/views/theme_helpers.cc
+++ b/chrome/browser/views/theme_helpers.cc
@@ -8,7 +8,7 @@
#include <atlapp.h>
#include <atltheme.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/logging.h"
#include "skia/ext/bitmap_platform_device_win.h"
#include "SkGradientShader.h"
@@ -23,7 +23,7 @@ void GetRebarGradientColors(int width, int x1, int x2,
// those so calling code can use them to create gradient brushes for use in
// rendering in other directions.
- ChromeCanvas canvas(width, 1, true);
+ gfx::Canvas canvas(width, 1, true);
// Render the Rebar gradient into the DIB
CTheme theme;
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index f1ae818..f120cd4 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -7,7 +7,7 @@
#include <string>
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
@@ -403,7 +403,7 @@ void BrowserToolbarView::Layout() {
app_menu_->SetBounds(next_menu_x, child_y, app_menu_width, child_height);
}
-void BrowserToolbarView::Paint(ChromeCanvas* canvas) {
+void BrowserToolbarView::Paint(gfx::Canvas* canvas) {
View::Paint(canvas);
if (IsDisplayModeNormal())
diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h
index 64feb34..9242466b 100644
--- a/chrome/browser/views/toolbar_view.h
+++ b/chrome/browser/views/toolbar_view.h
@@ -54,7 +54,7 @@ class BrowserToolbarView : public views::View,
// views::View
virtual void Layout();
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void DidGainFocus();
virtual void WillLoseFocus();
virtual bool OnKeyPressed(const views::KeyEvent& e);
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index ef608e1..4207ce8 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -178,15 +178,15 @@
'../app/app_switches.cc',
'../app/drag_drop_types.cc',
'../app/drag_drop_types.h',
- '../app/gfx/chrome_canvas.cc',
- '../app/gfx/chrome_canvas.h',
- '../app/gfx/chrome_canvas_linux.cc',
- '../app/gfx/chrome_canvas_win.cc',
- '../app/gfx/chrome_font.h',
- '../app/gfx/chrome_font_gtk.cc',
- '../app/gfx/chrome_font_mac.mm',
- '../app/gfx/chrome_font_skia.cc',
- '../app/gfx/chrome_font_win.cc',
+ '../app/gfx/canvas.cc',
+ '../app/gfx/canvas.h',
+ '../app/gfx/canvas_linux.cc',
+ '../app/gfx/canvas_win.cc',
+ '../app/gfx/font.h',
+ '../app/gfx/font_gtk.cc',
+ '../app/gfx/font_mac.mm',
+ '../app/gfx/font_skia.cc',
+ '../app/gfx/font_win.cc',
'../app/gfx/color_utils.cc',
'../app/gfx/color_utils.h',
'../app/gfx/favicon_size.h',
@@ -230,7 +230,7 @@
'conditions': [
['OS=="linux"', {
'dependencies': [
- # chrome_font_gtk.cc uses fontconfig.
+ # font_gtk.cc uses fontconfig.
# TODO(evanm): I think this is wrong; it should just use GTK.
'../build/linux/system.gyp:fontconfig',
'../build/linux/system.gyp:gtk',
@@ -2824,7 +2824,7 @@
'common/extensions/url_pattern_unittest.cc',
'common/extensions/user_script_unittest.cc',
'common/file_descriptor_set_unittest.cc',
- '../app/gfx/chrome_font_unittest.cc',
+ '../app/gfx/font_unittest.cc',
'common/gfx/emf_unittest.cc',
'../app/gfx/icon_util_unittest.cc',
'../app/gfx/text_elider_unittest.cc',
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 38f3af6..0075e79 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -4,7 +4,7 @@
#include "chrome/plugin/webplugin_proxy.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#if defined(OS_WIN)
#include "app/win_util.h"
#endif
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 4e05f1d..24a8ee4 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -10,7 +10,7 @@
#include <atlbase.h>
#endif
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
@@ -741,7 +741,7 @@ void WebPluginDelegateProxy::PaintSadPlugin(gfx::NativeDrawingContext hdc,
const int width = plugin_rect_.width();
const int height = plugin_rect_.height();
- ChromeCanvas canvas(width, height, false);
+ gfx::Canvas canvas(width, height, false);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj
index 6c8ddc5..348bfbb 100644
--- a/chrome/test/unit/unittests.vcproj
+++ b/chrome/test/unit/unittests.vcproj
@@ -508,15 +508,15 @@
>
</File>
<File
- RelativePath="..\..\browser\password_manager\encryptor_unittest.cc"
+ RelativePath="..\..\browser\encoding_menu_controller_unittest.cc"
>
</File>
<File
- RelativePath="..\..\browser\history\expire_history_backend_unittest.cc"
+ RelativePath="..\..\browser\password_manager\encryptor_unittest.cc"
>
</File>
<File
- RelativePath="..\..\browser\encoding_menu_controller_unittest.cc"
+ RelativePath="..\..\browser\history\expire_history_backend_unittest.cc"
>
</File>
<File
@@ -1112,7 +1112,7 @@
>
</File>
<File
- RelativePath="..\..\..\app\gfx\chrome_font_unittest.cc"
+ RelativePath="..\..\..\app\gfx\font_unittest.cc"
>
</File>
<File
diff --git a/views/DEPS b/views/DEPS
index e1ee8e0..2050eaa 100644
--- a/views/DEPS
+++ b/views/DEPS
@@ -1,9 +1,8 @@
include_rules = [
"+app",
- "+skia/ext",
- "+skia/include",
-
# TODO(beng): swap these with app/views specific generated resources.
"+grit/generated_resources.h",
"+grit/theme_resources.h",
+ "+skia/ext",
+ "+skia/include",
]
diff --git a/views/background.cc b/views/background.cc
index 37b1251..5206349 100644
--- a/views/background.cc
+++ b/views/background.cc
@@ -4,7 +4,7 @@
#include "views/background.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/logging.h"
#include "skia/ext/skia_utils_win.h"
#include "third_party/skia/include/core/SkPaint.h"
@@ -22,7 +22,7 @@ class SolidBackground : public Background {
SetNativeControlColor(color_);
}
- void Paint(ChromeCanvas* canvas, View* view) const {
+ void Paint(gfx::Canvas* canvas, View* view) const {
// Fill the background. Note that we don't constrain to the bounds as
// canvas is already clipped for us.
canvas->drawColor(color_);
@@ -47,7 +47,7 @@ class BackgroundPainter : public Background {
}
- void Paint(ChromeCanvas* canvas, View* view) const {
+ void Paint(gfx::Canvas* canvas, View* view) const {
Painter::PaintPainterAt(0, 0, view->width(), view->height(), canvas,
painter_);
}
diff --git a/views/background.h b/views/background.h
index efb2a63..1453749 100644
--- a/views/background.h
+++ b/views/background.h
@@ -14,7 +14,9 @@
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
-class ChromeCanvas;
+namespace gfx {
+class Canvas;
+}
namespace views {
@@ -65,7 +67,7 @@ class Background {
Painter* painter);
// Render the background for the provided view
- virtual void Paint(ChromeCanvas* canvas, View* view) const = 0;
+ virtual void Paint(gfx::Canvas* canvas, View* view) const = 0;
// Set a solid, opaque color to be used when drawing backgrounds of native
// controls. Unfortunately alpha=0 is not an option.
diff --git a/views/border.cc b/views/border.cc
index 9127bce..2e74135 100644
--- a/views/border.cc
+++ b/views/border.cc
@@ -4,7 +4,7 @@
#include "views/border.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/logging.h"
namespace views {
@@ -16,7 +16,7 @@ class SolidBorder : public Border {
public:
SolidBorder(int thickness, SkColor color);
- virtual void Paint(const View& view, ChromeCanvas* canvas) const;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const;
virtual void GetInsets(gfx::Insets* insets) const;
private:
@@ -33,7 +33,7 @@ SolidBorder::SolidBorder(int thickness, SkColor color)
insets_(thickness, thickness, thickness, thickness) {
}
-void SolidBorder::Paint(const View& view, ChromeCanvas* canvas) const {
+void SolidBorder::Paint(const View& view, gfx::Canvas* canvas) const {
gfx::Rect clip_rect;
if (!canvas->GetClipRect(&clip_rect))
return; // Empty clip rectangle, nothing to paint.
@@ -70,7 +70,7 @@ class EmptyBorder : public Border {
EmptyBorder(int top, int left, int bottom, int right)
: top_(top), left_(left), bottom_(bottom), right_(right) {}
- virtual void Paint(const View& view, ChromeCanvas* canvas) const {}
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const {}
virtual void GetInsets(gfx::Insets* insets) const {
DCHECK(insets);
diff --git a/views/border.h b/views/border.h
index 98086c2..0e9a41c 100644
--- a/views/border.h
+++ b/views/border.h
@@ -9,7 +9,9 @@
#include "third_party/skia/include/core/SkColor.h"
#include "views/view.h"
-class ChromeCanvas;
+namespace gfx{
+class Canvas;
+}
namespace views {
@@ -45,7 +47,7 @@ class Border {
static Border* CreateEmptyBorder(int top, int left, int bottom, int right);
// Renders the border for the specified view.
- virtual void Paint(const View& view, ChromeCanvas* canvas) const = 0;
+ virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0;
// Sets the specified insets to the the border insets.
virtual void GetInsets(gfx::Insets* insets) const = 0;
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
diff --git a/views/drag_utils.cc b/views/drag_utils.cc
index 85498b7..17ba99b 100644
--- a/views/drag_utils.cc
+++ b/views/drag_utils.cc
@@ -8,8 +8,8 @@
#include <shlobj.h>
#include <shobjidl.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/os_exchange_data.h"
#include "app/resource_bundle.h"
@@ -59,7 +59,7 @@ static void SetDragImageOnDataObject(HBITMAP hbitmap,
// Blit the contents of the canvas to a new HBITMAP. It is the caller's
// responsibility to release the |bits| buffer.
-static HBITMAP CreateBitmapFromCanvas(const ChromeCanvas& canvas,
+static HBITMAP CreateBitmapFromCanvas(const gfx::Canvas& canvas,
int width,
int height) {
HDC screen_dc = GetDC(NULL);
@@ -102,7 +102,7 @@ void SetURLAndDragImage(const GURL& url,
button.SetBounds(0, 0, prefsize.width(), prefsize.height());
// Render the image.
- ChromeCanvas canvas(prefsize.width(), prefsize.height(), false);
+ gfx::Canvas canvas(prefsize.width(), prefsize.height(), false);
button.Paint(&canvas, true);
SetDragImageOnDataObject(canvas, prefsize.width(), prefsize.height(),
prefsize.width() / 2, prefsize.height() / 2,
@@ -124,7 +124,7 @@ void CreateDragImageForFile(const std::wstring& file_name,
// Add +2 here to allow room for the halo.
const int height = font.height() + icon->height() +
kLinkDragImageVPadding + 2;
- ChromeCanvas canvas(width, height, false /* translucent */);
+ gfx::Canvas canvas(width, height, false /* translucent */);
// Paint the icon.
canvas.DrawBitmapInt(*icon, (width - icon->width()) / 2, 0);
@@ -133,13 +133,13 @@ void CreateDragImageForFile(const std::wstring& file_name,
canvas.DrawStringWithHalo(name, font, kFileDragImageTextColor, SK_ColorWHITE,
1, icon->height() + kLinkDragImageVPadding + 1,
width - 2, font.height(),
- ChromeCanvas::TEXT_ALIGN_CENTER);
+ gfx::Canvas::TEXT_ALIGN_CENTER);
SetDragImageOnDataObject(canvas, width, height, width / 2,
kLinkDragImageVPadding, data_object);
}
-void SetDragImageOnDataObject(const ChromeCanvas& canvas,
+void SetDragImageOnDataObject(const gfx::Canvas& canvas,
int width,
int height,
int cursor_x_offset,
diff --git a/views/drag_utils.h b/views/drag_utils.h
index 22855cfa..5cf68af8 100644
--- a/views/drag_utils.h
+++ b/views/drag_utils.h
@@ -8,7 +8,9 @@
#include <objidl.h>
#include <string>
-class ChromeCanvas;
+namespace gfx {
+class Canvas;
+}
class GURL;
class OSExchangeData;
class SkBitmap;
@@ -33,7 +35,7 @@ void CreateDragImageForFile(const std::wstring& file_name,
// Sets the drag image on data_object from the supplied canvas. width/height
// are the size of the image to use, and the offsets give the location of
// the hotspot for the drag image.
-void SetDragImageOnDataObject(const ChromeCanvas& canvas,
+void SetDragImageOnDataObject(const gfx::Canvas& canvas,
int width,
int height,
int cursor_x_offset,
diff --git a/views/painter.cc b/views/painter.cc
index d44eef8..438c851 100644
--- a/views/painter.cc
+++ b/views/painter.cc
@@ -4,7 +4,7 @@
#include "views/painter.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -25,7 +25,7 @@ class GradientPainter : public Painter {
virtual ~GradientPainter() {
}
- void Paint(int w, int h, ChromeCanvas* canvas) {
+ void Paint(int w, int h, gfx::Canvas* canvas) {
SkPaint paint;
SkPoint p[2];
p[0].set(SkIntToScalar(0), SkIntToScalar(0));
@@ -58,7 +58,7 @@ class GradientPainter : public Painter {
// static
void Painter::PaintPainterAt(int x, int y, int w, int h,
- ChromeCanvas* canvas, Painter* painter) {
+ gfx::Canvas* canvas, Painter* painter) {
DCHECK(canvas && painter);
if (w < 0 || h < 0)
return;
@@ -77,7 +77,7 @@ ImagePainter::ImagePainter(const int image_resource_names[],
images_.push_back(rb.GetBitmapNamed(image_resource_names[i]));
}
-void ImagePainter::Paint(int w, int h, ChromeCanvas* canvas) {
+void ImagePainter::Paint(int w, int h, gfx::Canvas* canvas) {
canvas->DrawBitmapInt(*images_[BORDER_TOP_LEFT], 0, 0);
canvas->TileImageInt(*images_[BORDER_TOP],
images_[BORDER_TOP_LEFT]->width(),
@@ -147,7 +147,7 @@ HorizontalPainter::HorizontalPainter(const int image_resource_names[]) {
images_[LEFT]->height() == images_[CENTER]->height());
}
-void HorizontalPainter::Paint(int w, int h, ChromeCanvas* canvas) {
+void HorizontalPainter::Paint(int w, int h, gfx::Canvas* canvas) {
if (w < (images_[LEFT]->width() + images_[CENTER]->width() +
images_[RIGHT]->width())) {
// No room to paint.
diff --git a/views/painter.h b/views/painter.h
index 71d5565..9cef45f 100644
--- a/views/painter.h
+++ b/views/painter.h
@@ -10,7 +10,9 @@
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
-class ChromeCanvas;
+namespace gfx {
+class Canvas;
+}
class SkBitmap;
namespace views {
@@ -23,7 +25,7 @@ class Painter {
// A convenience method for painting a Painter in a particular region.
// This translates the canvas to x/y and paints the painter.
static void PaintPainterAt(int x, int y, int w, int h,
- ChromeCanvas* canvas, Painter* painter);
+ gfx::Canvas* canvas, Painter* painter);
// Creates a painter that draws a gradient between the two colors.
static Painter* CreateHorizontalGradient(SkColor c1, SkColor c2);
@@ -32,7 +34,7 @@ class Painter {
virtual ~Painter() {}
// Paints the painter in the specified region.
- virtual void Paint(int w, int h, ChromeCanvas* canvas) = 0;
+ virtual void Paint(int w, int h, gfx::Canvas* canvas) = 0;
};
// ImagePainter paints 8 (or 9) images into a box. The four corner
@@ -64,7 +66,7 @@ class ImagePainter : public Painter {
virtual ~ImagePainter() {}
// Paints the images.
- virtual void Paint(int w, int h, ChromeCanvas* canvas);
+ virtual void Paint(int w, int h, gfx::Canvas* canvas);
// Returns the specified image. The returned image should NOT be deleted.
SkBitmap* GetImage(BorderElements element) {
@@ -94,7 +96,7 @@ class HorizontalPainter : public Painter {
virtual ~HorizontalPainter() {}
// Paints the images.
- virtual void Paint(int w, int h, ChromeCanvas* canvas);
+ virtual void Paint(int w, int h, gfx::Canvas* canvas);
// Height of the images.
int height() const { return height_; }
diff --git a/views/view.cc b/views/view.cc
index 5430a8f..e085f15 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -10,7 +10,7 @@
#endif
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "base/logging.h"
#include "base/message_loop.h"
@@ -299,28 +299,28 @@ void View::SchedulePaint(int x, int y, int w, int h) {
SchedulePaint(gfx::Rect(x, y, w, h), false);
}
-void View::Paint(ChromeCanvas* canvas) {
+void View::Paint(gfx::Canvas* canvas) {
PaintBackground(canvas);
PaintFocusBorder(canvas);
PaintBorder(canvas);
}
-void View::PaintBackground(ChromeCanvas* canvas) {
+void View::PaintBackground(gfx::Canvas* canvas) {
if (background_.get())
background_->Paint(canvas, this);
}
-void View::PaintBorder(ChromeCanvas* canvas) {
+void View::PaintBorder(gfx::Canvas* canvas) {
if (border_.get())
border_->Paint(*this, canvas);
}
-void View::PaintFocusBorder(ChromeCanvas* canvas) {
+void View::PaintFocusBorder(gfx::Canvas* canvas) {
if (HasFocus() && IsFocusable())
canvas->DrawFocusRect(0, 0, width(), height());
}
-void View::PaintChildren(ChromeCanvas* canvas) {
+void View::PaintChildren(gfx::Canvas* canvas) {
int i, c;
for (i = 0, c = GetChildViewCount(); i < c; ++i) {
View* child = GetChildViewAt(i);
@@ -332,7 +332,7 @@ void View::PaintChildren(ChromeCanvas* canvas) {
}
}
-void View::ProcessPaint(ChromeCanvas* canvas) {
+void View::ProcessPaint(gfx::Canvas* canvas) {
if (!IsVisible()) {
return;
}
diff --git a/views/view.h b/views/view.h
index 16c1f35..8612248 100644
--- a/views/view.h
+++ b/views/view.h
@@ -24,11 +24,11 @@ struct IDataObject;
#endif // defined(OS_WIN)
namespace gfx {
+class Canvas;
class Insets;
class Path;
}
-class ChromeCanvas;
class OSExchangeData;
class ViewAccessibilityWrapper;
class ThemeProvider;
@@ -288,19 +288,19 @@ class View : public AcceleratorTarget {
ui_mirroring_is_enabled_for_rtl_languages_ = enable;
}
- // This method determines whether the ChromeCanvas object passed to
+ // This method determines whether the gfx::Canvas object passed to
// View::Paint() needs to be transformed such that anything drawn on the
// canvas object during View::Paint() is flipped horizontally.
//
// By default, this function returns false (which is the initial value of
// |flip_canvas_on_paint_for_rtl_ui_|). View subclasses that need to paint on
- // a flipped ChromeCanvas when the UI layout is right-to-left need to call
+ // a flipped gfx::Canvas when the UI layout is right-to-left need to call
// EnableCanvasFlippingForRTLUI().
bool FlipCanvasOnPaintForRTLUI() const {
return flip_canvas_on_paint_for_rtl_ui_ ? UILayoutIsRightToLeft() : false;
}
- // Enables or disables flipping of the ChromeCanvas during View::Paint().
+ // Enables or disables flipping of the gfx::Canvas during View::Paint().
// Note that if canvas flipping is enabled, the canvas will be flipped only
// if the UI layout is right-to-left; that is, the canvas will be flipped
// only if UILayoutIsRightToLeft() returns true.
@@ -368,21 +368,21 @@ class View : public AcceleratorTarget {
// Default implementation paints the background if it is defined
//
// Override this method when implementing a new control.
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// Paint the background if any. This method is called by Paint() and
// should rarely be invoked directly.
- virtual void PaintBackground(ChromeCanvas* canvas);
+ virtual void PaintBackground(gfx::Canvas* canvas);
// Paint the border if any. This method is called by Paint() and
// should rarely be invoked directly.
- virtual void PaintBorder(ChromeCanvas* canvas);
+ virtual void PaintBorder(gfx::Canvas* canvas);
// Paints the focus border (only if the view has the focus).
// This method is called by Paint() and should rarely be invoked directly.
// The default implementation paints a gray border around the view. Override
// it for custom focus effects.
- virtual void PaintFocusBorder(ChromeCanvas* canvas);
+ virtual void PaintFocusBorder(gfx::Canvas* canvas);
// Paint this View immediately.
virtual void PaintNow();
@@ -786,10 +786,10 @@ class View : public AcceleratorTarget {
// inside a custom graphics.
// To customize painting override either the Paint or PaintChildren method,
// not this one.
- virtual void ProcessPaint(ChromeCanvas* canvas);
+ virtual void ProcessPaint(gfx::Canvas* canvas);
// Paint the View's child Views, in reverse order.
- virtual void PaintChildren(ChromeCanvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas);
// Sets the ContextMenuController. Setting this to non-null makes the View
// process mouse events.
@@ -1199,7 +1199,7 @@ class View : public AcceleratorTarget {
// language like Arabic or Hebrew.
bool ui_mirroring_is_enabled_for_rtl_languages_;
- // Indicates whether or not the ChromeCanvas object passed to View::Paint()
+ // Indicates whether or not the gfx::Canvas object passed to View::Paint()
// is going to be flipped horizontally (using the appropriate transform) on
// right-to-left locales for this View.
bool flip_canvas_on_paint_for_rtl_ui_;
diff --git a/views/view_unittest.cc b/views/view_unittest.cc
index 11d5821..b5377eb 100644
--- a/views/view_unittest.cc
+++ b/views/view_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/gfx/path.h"
#include "base/clipboard.h"
#include "base/message_loop.h"
@@ -48,7 +48,7 @@ void PaintRootView(views::RootView* root, bool empty_paint) {
// User isn't logged in, so that PaintNow will generate an empty rectangle.
// Invoke paint directly.
gfx::Rect paint_rect = root->GetScheduledPaintRect();
- ChromeCanvas canvas(paint_rect.width(), paint_rect.height(), true);
+ gfx::Canvas canvas(paint_rect.width(), paint_rect.height(), true);
canvas.TranslateInt(-paint_rect.x(), -paint_rect.y());
canvas.ClipRectInt(0, 0, paint_rect.width(), paint_rect.height());
root->ProcessPaint(&canvas);
@@ -131,7 +131,7 @@ class TestView : public View {
virtual bool OnMousePressed(const MouseEvent& event);
virtual bool OnMouseDragged(const MouseEvent& event);
virtual void OnMouseReleased(const MouseEvent& event, bool canceled);
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
// DidChangeBounds test
bool did_change_bounds_;
@@ -350,7 +350,7 @@ TEST_F(ViewTest, MouseEvent) {
// Painting
////////////////////////////////////////////////////////////////////////////////
-void TestView::Paint(ChromeCanvas* canvas) {
+void TestView::Paint(gfx::Canvas* canvas) {
canvas->getClipBounds(&last_clip_);
}
diff --git a/views/view_win.cc b/views/view_win.cc
index 6dfe183..92a6396 100644
--- a/views/view_win.cc
+++ b/views/view_win.cc
@@ -5,7 +5,7 @@
#include "views/view.h"
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/os_exchange_data.h"
#include "base/scoped_handle.h"
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index bc012c8..fb64756 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -7,7 +7,7 @@
#include <algorithm>
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#if defined(OS_WIN)
#include "base/base_drag_source.h"
#endif
@@ -147,7 +147,7 @@ class ScopedProcessingPaint {
};
#endif
-void RootView::ProcessPaint(ChromeCanvas* canvas) {
+void RootView::ProcessPaint(gfx::Canvas* canvas) {
#ifndef NDEBUG
ScopedProcessingPaint processing_paint(&is_processing_paint_);
#endif
diff --git a/views/widget/root_view.h b/views/widget/root_view.h
index 1ebb3e1..ae73eef 100644
--- a/views/widget/root_view.h
+++ b/views/widget/root_view.h
@@ -65,7 +65,7 @@ class RootView : public View,
virtual void SchedulePaint(int x, int y, int w, int h);
// Paint this RootView and its child Views.
- virtual void ProcessPaint(ChromeCanvas* canvas);
+ virtual void ProcessPaint(gfx::Canvas* canvas);
// If the invalid rect is non-empty and there is a pending paint the RootView
// is painted immediately. This is internally invoked as the result of
diff --git a/views/widget/root_view_gtk.cc b/views/widget/root_view_gtk.cc
index 61bb5f5..9010960 100644
--- a/views/widget/root_view_gtk.cc
+++ b/views/widget/root_view_gtk.cc
@@ -6,7 +6,7 @@
#include <gtk/gtk.h>
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -17,7 +17,7 @@ void RootView::UpdateCursor(const MouseEvent& e) {
}
void RootView::OnPaint(GdkEventExpose* event) {
- ChromeCanvasPaint canvas(event);
+ gfx::CanvasPaint canvas(event);
if (!canvas.isEmpty()) {
SchedulePaint(gfx::Rect(canvas.rectangle()), false);
diff --git a/views/widget/root_view_win.cc b/views/widget/root_view_win.cc
index ac4a50d..14ca68a6 100644
--- a/views/widget/root_view_win.cc
+++ b/views/widget/root_view_win.cc
@@ -5,7 +5,7 @@
#include "views/widget/root_view.h"
#include "app/drag_drop_types.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "base/base_drag_source.h"
#include "base/logging.h"
#include "views/widget/root_view_drop_target.h"
@@ -40,7 +40,7 @@ void RootView::OnPaint(HWND hwnd) {
RECT win_version = original_dirty_region.ToRECT();
InvalidateRect(hwnd, &win_version, FALSE);
}
- ChromeCanvasPaint canvas(hwnd);
+ gfx::CanvasPaint canvas(hwnd);
if (!canvas.isEmpty()) {
const PAINTSTRUCT& ps = canvas.paintStruct();
SchedulePaint(gfx::Rect(ps.rcPaint), false);
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 5da1b63..e58978f 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -4,7 +4,7 @@
#include "views/widget/widget_win.h"
-#include "app/gfx/chrome_canvas.h"
+#include "app/gfx/canvas.h"
#include "app/win_util.h"
#include "base/gfx/native_theme.h"
#include "base/string_util.h"
@@ -898,9 +898,9 @@ Window* WidgetWin::GetWindowImpl(HWND hwnd) {
}
void WidgetWin::SizeContents(const CRect& window_rect) {
- contents_.reset(new ChromeCanvas(window_rect.Width(),
- window_rect.Height(),
- false));
+ contents_.reset(new gfx::Canvas(window_rect.Width(),
+ window_rect.Height(),
+ false));
}
void WidgetWin::PaintLayeredWindow() {
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index b39362f..ae846aa 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -16,9 +16,8 @@
#include "views/layout_manager.h"
#include "views/widget/widget.h"
-class ChromeCanvas;
-
namespace gfx {
+class Canvas;
class Rect;
}
@@ -608,7 +607,7 @@ class WidgetWin : public Widget,
// A canvas that contains the window contents in the case of a layered
// window.
- scoped_ptr<ChromeCanvas> contents_;
+ scoped_ptr<gfx::Canvas> contents_;
// Whether or not the window should delete itself when it is destroyed.
// Set this to false via its setter for stack allocated instances.
diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc
index f7f9ab3..2869c07 100644
--- a/views/window/custom_frame_view.cc
+++ b/views/window/custom_frame_view.cc
@@ -4,8 +4,8 @@
#include "views/window/custom_frame_view.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/path.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
@@ -210,7 +210,7 @@ void CustomFrameView::ResetWindowControls() {
///////////////////////////////////////////////////////////////////////////////
// CustomFrameView, View overrides:
-void CustomFrameView::Paint(ChromeCanvas* canvas) {
+void CustomFrameView::Paint(gfx::Canvas* canvas) {
if (frame_->IsMaximized())
PaintMaximizedFrameBorder(canvas);
else
@@ -295,7 +295,7 @@ int CustomFrameView::TitleCoordinates(int* title_top_spacing,
BottomEdgeThicknessWithinNonClientHeight();
}
-void CustomFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
+void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
// Window frame mode.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -373,7 +373,7 @@ void CustomFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
}
void CustomFrameView::PaintMaximizedFrameBorder(
- ChromeCanvas* canvas) {
+ gfx::Canvas* canvas) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
SkBitmap* top_edge = rb.GetBitmapNamed(IDR_WINDOW_TOP_CENTER);
@@ -388,7 +388,7 @@ void CustomFrameView::PaintMaximizedFrameBorder(
frame_->GetClientView()->y() - edge_height, width(), edge_height);
}
-void CustomFrameView::PaintTitleBar(ChromeCanvas* canvas) {
+void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) {
WindowDelegate* d = frame_->GetDelegate();
// It seems like in some conditions we can be asked to paint after the window
@@ -402,7 +402,7 @@ void CustomFrameView::PaintTitleBar(ChromeCanvas* canvas) {
title_bounds_.width(), title_bounds_.height());
}
-void CustomFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
+void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
gfx::Rect client_area_bounds = frame_->GetClientView()->bounds();
int client_area_top = client_area_bounds.y();
diff --git a/views/window/custom_frame_view.h b/views/window/custom_frame_view.h
index 0c41009..bee9e62 100644
--- a/views/window/custom_frame_view.h
+++ b/views/window/custom_frame_view.h
@@ -11,12 +11,12 @@
#include "views/window/window_resources.h"
namespace gfx{
+class Canvas;
class Font;
class Size;
class Path;
class Point;
}
-class ChromeCanvas;
namespace views {
@@ -45,7 +45,7 @@ class CustomFrameView : public NonClientFrameView,
virtual void ResetWindowControls();
// View overrides:
- virtual void Paint(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
@@ -75,10 +75,10 @@ class CustomFrameView : public NonClientFrameView,
int* title_thickness) const;
// Paint various sub-components of this view.
- void PaintRestoredFrameBorder(ChromeCanvas* canvas);
- void PaintMaximizedFrameBorder(ChromeCanvas* canvas);
- void PaintTitleBar(ChromeCanvas* canvas);
- void PaintRestoredClientEdge(ChromeCanvas* canvas);
+ void PaintRestoredFrameBorder(gfx::Canvas* canvas);
+ void PaintMaximizedFrameBorder(gfx::Canvas* canvas);
+ void PaintTitleBar(gfx::Canvas* canvas);
+ void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutWindowControls();
diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc
index 9e25462..978d45a 100644
--- a/views/window/dialog_client_view.cc
+++ b/views/window/dialog_client_view.cc
@@ -8,8 +8,8 @@
#include <uxtheme.h>
#include <vsstyle.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"
@@ -34,7 +34,7 @@ void UpdateButtonHelper(NativeButton* button_view,
button_view->SetVisible(delegate->IsDialogButtonVisible(button));
}
-void FillViewWithSysColor(ChromeCanvas* canvas, View* view, COLORREF color) {
+void FillViewWithSysColor(gfx::Canvas* canvas, View* view, COLORREF color) {
SkColor sk_color =
SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color));
canvas->FillRectInt(sk_color, 0, 0, view->width(), view->height());
@@ -250,11 +250,11 @@ int DialogClientView::NonClientHitTest(const gfx::Point& point) {
////////////////////////////////////////////////////////////////////////////////
// DialogClientView, View overrides:
-void DialogClientView::Paint(ChromeCanvas* canvas) {
+void DialogClientView::Paint(gfx::Canvas* canvas) {
FillViewWithSysColor(canvas, this, GetSysColor(COLOR_3DFACE));
}
-void DialogClientView::PaintChildren(ChromeCanvas* canvas) {
+void DialogClientView::PaintChildren(gfx::Canvas* canvas) {
View::PaintChildren(canvas);
if (!window()->IsMaximized() && !window()->IsMinimized())
PaintSizeBox(canvas);
@@ -347,7 +347,7 @@ void DialogClientView::ButtonPressed(Button* sender) {
////////////////////////////////////////////////////////////////////////////////
// DialogClientView, private:
-void DialogClientView::PaintSizeBox(ChromeCanvas* canvas) {
+void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
if (window()->GetDelegate()->CanResize() ||
window()->GetDelegate()->CanMaximize()) {
HDC dc = canvas->beginPlatformPaint();
diff --git a/views/window/dialog_client_view.h b/views/window/dialog_client_view.h
index c1e6ed8..ecb9449 100644
--- a/views/window/dialog_client_view.h
+++ b/views/window/dialog_client_view.h
@@ -5,7 +5,7 @@
#ifndef VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_
#define VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_
-#include "app/gfx/chrome_font.h"
+#include "app/gfx/font.h"
#include "views/focus/focus_manager.h"
#include "views/controls/button/button.h"
#include "views/window/client_view.h"
@@ -61,8 +61,8 @@ class DialogClientView : public ClientView,
protected:
// View overrides:
- virtual void Paint(ChromeCanvas* canvas);
- virtual void PaintChildren(ChromeCanvas* canvas);
+ virtual void Paint(gfx::Canvas* canvas);
+ virtual void PaintChildren(gfx::Canvas* canvas);
virtual void Layout();
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
virtual gfx::Size GetPreferredSize();
@@ -74,7 +74,7 @@ class DialogClientView : public ClientView,
private:
// Paint the size box in the bottom right corner of the window if it is
// resizable.
- void PaintSizeBox(ChromeCanvas* canvas);
+ void PaintSizeBox(gfx::Canvas* canvas);
// Returns the width of the specified dialog button using the correct font.
int GetButtonWidth(int button) const;
diff --git a/views/window/window_win.cc b/views/window/window_win.cc
index 9c06e21..78fa32e 100644
--- a/views/window/window_win.cc
+++ b/views/window/window_win.cc
@@ -6,8 +6,8 @@
#include <shellapi.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/icon_util.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
@@ -862,11 +862,11 @@ void WindowWin::OnNCPaint(HRGN rgn) {
root_view->SchedulePaint(gfx::Rect(dirty_region), false);
- // ChromeCanvasPaints destructor does the actual painting. As such, wrap the
+ // gfx::CanvasPaints destructor does the actual painting. As such, wrap the
// following in a block to force paint to occur so that we can release the dc.
{
- ChromeCanvasPaint canvas(dc, opaque(), dirty_region.left, dirty_region.top,
- dirty_region.Width(), dirty_region.Height());
+ gfx::CanvasPaint canvas(dc, opaque(), dirty_region.left, dirty_region.top,
+ dirty_region.Width(), dirty_region.Height());
root_view->ProcessPaint(&canvas);
}