Upstream version 10.38.208.0
[platform/framework/web/crosswalk.git] / src / ui / views / bubble / tray_bubble_view.cc
index 31c163d..aad1ba7 100644 (file)
@@ -13,7 +13,6 @@
 #include "third_party/skia/include/effects/SkBlurImageFilter.h"
 #include "ui/accessibility/ax_view_state.h"
 #include "ui/aura/window.h"
-#include "ui/base/l10n/l10n_util.h"
 #include "ui/compositor/layer.h"
 #include "ui/compositor/layer_delegate.h"
 #include "ui/events/event.h"
@@ -59,7 +58,6 @@ class MouseMoveDetectorHost : public MouseWatcherHost {
   virtual bool Contains(const gfx::Point& screen_point,
                         MouseEventType type) OVERRIDE;
  private:
-
   DISALLOW_COPY_AND_ASSIGN(MouseMoveDetectorHost);
 };
 
@@ -327,7 +325,6 @@ TrayBubbleView::TrayBubbleView(gfx::NativeView parent_window,
       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_);
@@ -382,6 +379,7 @@ void TrayBubbleView::SetWidth(int width) {
 void TrayBubbleView::SetArrowPaintType(
     views::BubbleBorder::ArrowPaintType paint_type) {
   bubble_border_->set_paint_arrow(paint_type);
+  UpdateBubble();
 }
 
 gfx::Insets TrayBubbleView::GetBorderInsets() const {
@@ -390,11 +388,11 @@ 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(),
@@ -421,21 +419,21 @@ void TrayBubbleView::GetWidgetHitTestMask(gfx::Path* mask) const {
   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);
   }