diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 07:37:29 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 07:37:29 +0000 |
commit | 82522511b7921e8c61742ebd80a4c674c56e7e48 (patch) | |
tree | 381d71de2b9c7b99675e6f2b4523ae0876c72ce8 /chrome/browser/views/tabs | |
parent | 631cf822bd6e64cf469544b42c9975f5602c29a6 (diff) | |
download | chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.zip chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.tar.gz chromium_src-82522511b7921e8c61742ebd80a4c674c56e7e48.tar.bz2 |
ChromeCanvas->gfx::Canvas
Rename files too.
TBR=brettw
http://crbug.com/11387
Review URL: http://codereview.chromium.org/113443
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_view.h | 8 | ||||
-rw-r--r-- | chrome/browser/views/tabs/hwnd_photobooth.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/hwnd_photobooth.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.cc | 16 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_renderer.h | 12 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.h | 2 |
10 files changed, 37 insertions, 35 deletions
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(); |