OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const InitParams& init_params) | 318 const InitParams& init_params) |
319 : BubbleDelegateView(anchor, init_params.arrow), | 319 : BubbleDelegateView(anchor, init_params.arrow), |
320 params_(init_params), | 320 params_(init_params), |
321 delegate_(delegate), | 321 delegate_(delegate), |
322 preferred_width_(init_params.min_width), | 322 preferred_width_(init_params.min_width), |
323 bubble_border_(NULL), | 323 bubble_border_(NULL), |
324 is_gesture_dragging_(false), | 324 is_gesture_dragging_(false), |
325 mouse_actively_entered_(false) { | 325 mouse_actively_entered_(false) { |
326 set_parent_window(parent_window); | 326 set_parent_window(parent_window); |
327 set_notify_enter_exit_on_child(true); | 327 set_notify_enter_exit_on_child(true); |
| 328 set_move_with_anchor(true); |
328 set_close_on_deactivate(init_params.close_on_deactivate); | 329 set_close_on_deactivate(init_params.close_on_deactivate); |
329 set_margins(gfx::Insets()); | 330 set_margins(gfx::Insets()); |
330 bubble_border_ = new TrayBubbleBorder(this, GetAnchorView(), params_); | 331 bubble_border_ = new TrayBubbleBorder(this, GetAnchorView(), params_); |
331 if (get_use_acceleration_when_possible()) { | 332 if (get_use_acceleration_when_possible()) { |
332 SetPaintToLayer(true); | 333 SetPaintToLayer(true); |
333 SetFillsBoundsOpaquely(true); | 334 SetFillsBoundsOpaquely(true); |
334 | 335 |
335 bubble_content_mask_.reset( | 336 bubble_content_mask_.reset( |
336 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius())); | 337 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius())); |
337 } | 338 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 const ViewHierarchyChangedDetails& details) { | 502 const ViewHierarchyChangedDetails& details) { |
502 if (get_use_acceleration_when_possible() && details.is_add && | 503 if (get_use_acceleration_when_possible() && details.is_add && |
503 details.child == this) { | 504 details.child == this) { |
504 details.parent->SetPaintToLayer(true); | 505 details.parent->SetPaintToLayer(true); |
505 details.parent->SetFillsBoundsOpaquely(true); | 506 details.parent->SetFillsBoundsOpaquely(true); |
506 details.parent->layer()->SetMasksToBounds(true); | 507 details.parent->layer()->SetMasksToBounds(true); |
507 } | 508 } |
508 } | 509 } |
509 | 510 |
510 } // namespace views | 511 } // namespace views |
OLD | NEW |