browser_(browser),
page_action_(page_action),
current_tab_id_(-1),
- preview_enabled_(false),
- scoped_icon_animation_observer_(
- page_action->GetIconAnimation(
- SessionID::IdForTab(owner->GetWebContents())),
- this) {
+ preview_enabled_(false) {
const Extension* extension = browser->profile()->GetExtensionService()->
GetExtensionById(page_action->extension_id(), false);
DCHECK(extension);
return extensions::IconsInfo::kPageActionIconMaxSize;
}
-void PageActionDecoration::DrawWithBackgroundInFrame(NSRect background_frame,
- NSRect frame,
- NSView* control_view) {
- {
- gfx::Rect bounds(NSRectToCGRect(background_frame));
- gfx::CanvasSkiaPaint canvas(background_frame, /*opaque=*/false);
- // set_composite_alpha(true) makes the extension action paint on top of the
- // location bar instead of whatever's behind the Chrome window.
- canvas.set_composite_alpha(true);
- location_bar_util::PaintExtensionActionBackground(
- *page_action_, current_tab_id_,
- &canvas, bounds,
- SK_ColorBLACK, SK_ColorWHITE);
- // Destroying |canvas| draws the background.
- }
-
- ImageDecoration::DrawWithBackgroundInFrame(
- background_frame, frame, control_view);
-}
-
bool PageActionDecoration::AcceptsMousePress() {
return true;
}
devMode:NO];
}
-void PageActionDecoration::OnIconChanged() {
- UpdateVisibility(owner_->GetWebContents(), current_url_);
- owner_->RedrawDecoration(this);
-}
-
void PageActionDecoration::Observe(
int type,
const content::NotificationSource& source,