#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
+#include "ui/accessibility/ax_view_state.h"
#include "ui/aura/window.h"
-#include "ui/base/accessibility/accessible_view_state.h"
-#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_delegate.h"
#include "ui/events/event.h"
virtual bool Contains(const gfx::Point& screen_point,
MouseEventType type) OVERRIDE;
private:
-
DISALLOW_COPY_AND_ASSIGN(MouseMoveDetectorHost);
};
mouse_actively_entered_(false) {
set_parent_window(parent_window);
set_notify_enter_exit_on_child(true);
- set_move_with_anchor(true);
set_close_on_deactivate(init_params.close_on_deactivate);
set_margins(gfx::Insets());
bubble_border_ = new TrayBubbleBorder(this, GetAnchorView(), params_);
- if (get_use_acceleration_when_possible()) {
- SetPaintToLayer(true);
- SetFillsBoundsOpaquely(true);
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(true);
- bubble_content_mask_.reset(
- new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius()));
- }
+ bubble_content_mask_.reset(
+ new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius()));
}
TrayBubbleView::~TrayBubbleView() {
SetAlignment(params_.arrow_alignment);
bubble_border_->UpdateArrowOffset();
- if (get_use_acceleration_when_possible())
- layer()->parent()->SetMaskLayer(bubble_content_mask_->layer());
+ layer()->parent()->SetMaskLayer(bubble_content_mask_->layer());
GetWidget()->Show();
- GetWidget()->GetNativeWindow()->set_event_targeter(
+ GetWidget()->GetNativeWindow()->SetEventTargeter(
scoped_ptr<ui::EventTargeter>(new BubbleWindowTargeter(this)));
UpdateBubble();
}
void TrayBubbleView::UpdateBubble() {
SizeToContents();
- if (get_use_acceleration_when_possible())
- bubble_content_mask_->layer()->SetBounds(layer()->bounds());
+ bubble_content_mask_->layer()->SetBounds(layer()->bounds());
GetWidget()->GetRootView()->SchedulePaint();
}
void TrayBubbleView::SetArrowPaintType(
views::BubbleBorder::ArrowPaintType paint_type) {
bubble_border_->set_paint_arrow(paint_type);
+ UpdateBubble();
}
gfx::Insets TrayBubbleView::GetBorderInsets() const {
void TrayBubbleView::Init() {
BoxLayout* layout = new BottomAlignedBoxLayout(this);
- layout->set_spread_blank_space(true);
+ layout->SetDefaultFlex(1);
SetLayoutManager(layout);
}
-gfx::Rect TrayBubbleView::GetAnchorRect() {
+gfx::Rect TrayBubbleView::GetAnchorRect() const {
if (!delegate_)
return gfx::Rect();
return delegate_->GetAnchorRect(anchor_widget(),
mask->addRect(gfx::RectToSkRect(GetBubbleFrameView()->GetContentsBounds()));
}
-gfx::Size TrayBubbleView::GetPreferredSize() {
+gfx::Size TrayBubbleView::GetPreferredSize() const {
return gfx::Size(preferred_width_, GetHeightForWidth(preferred_width_));
}
-gfx::Size TrayBubbleView::GetMaximumSize() {
+gfx::Size TrayBubbleView::GetMaximumSize() const {
gfx::Size size = GetPreferredSize();
size.set_width(params_.max_width);
return size;
}
-int TrayBubbleView::GetHeightForWidth(int width) {
+int TrayBubbleView::GetHeightForWidth(int width) const {
int height = GetInsets().height();
width = std::max(width - GetInsets().width(), 0);
for (int i = 0; i < child_count(); ++i) {
- View* child = child_at(i);
+ const View* child = child_at(i);
if (child->visible())
height += child->GetHeightForWidth(width);
}
delegate_->OnMouseExitedView();
}
-void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) {
+void TrayBubbleView::GetAccessibleState(ui::AXViewState* state) {
if (delegate_ && params_.can_activate) {
- state->role = ui::AccessibilityTypes::ROLE_WINDOW;
+ state->role = ui::AX_ROLE_WINDOW;
state->name = delegate_->GetAccessibleNameForBubble();
}
}
void TrayBubbleView::ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) {
- if (get_use_acceleration_when_possible() && details.is_add &&
- details.child == this) {
+ if (details.is_add && details.child == this) {
details.parent->SetPaintToLayer(true);
details.parent->SetFillsBoundsOpaquely(true);
details.parent->layer()->SetMasksToBounds(true);