Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5253)

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 1054783003: views: Access the Canvas through recorders not through PaintContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/page_action_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index 92f29c2c5d78973d29d2b53338de4daaad6090ab..266a521b46bdcf91df6a2f89a734290b12fa819b 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -14,6 +14,7 @@
#include "extensions/browser/extension_registry.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
@@ -112,9 +113,9 @@ void PageActionImageView::PaintChildren(const ui::PaintContext& context) {
View::PaintChildren(context);
int tab_id = SessionTabHelper::IdForTab(GetCurrentWebContents());
if (tab_id >= 0) {
- gfx::Canvas* canvas = context.canvas();
- view_controller_->extension_action()->PaintBadge(
- canvas, GetLocalBounds(), tab_id);
+ ui::PaintRecorder recorder(context);
+ view_controller_->extension_action()->PaintBadge(recorder.canvas(),
+ GetLocalBounds(), tab_id);
}
}

Powered by Google App Engine
This is Rietveld 408576698