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 "chrome/browser/ui/views/status_bubble_views.h" | 5 #include "chrome/browser/ui/views/status_bubble_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/base/text/text_elider.h" | 25 #include "ui/base/text/text_elider.h" |
26 #include "ui/gfx/canvas.h" | 26 #include "ui/gfx/canvas.h" |
27 #include "ui/gfx/point.h" | 27 #include "ui/gfx/point.h" |
28 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
29 #include "ui/views/controls/label.h" | 29 #include "ui/views/controls/label.h" |
30 #include "ui/views/controls/scrollbar/native_scroll_bar.h" | 30 #include "ui/views/controls/scrollbar/native_scroll_bar.h" |
31 #include "ui/views/widget/root_view.h" | 31 #include "ui/views/widget/root_view.h" |
32 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
33 | 33 |
| 34 #if defined(USE_ASH) |
| 35 #include "ash/wm/property_util.h" |
| 36 #endif |
| 37 |
34 using views::Widget; | 38 using views::Widget; |
35 | 39 |
36 // The alpha and color of the bubble's shadow. | 40 // The alpha and color of the bubble's shadow. |
37 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); | 41 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); |
38 | 42 |
39 // The roundedness of the edges of our bubble. | 43 // The roundedness of the edges of our bubble. |
40 static const int kBubbleCornerRadius = 4; | 44 static const int kBubbleCornerRadius = 4; |
41 | 45 |
42 // How close the mouse can get to the infobubble before it starts sliding | 46 // How close the mouse can get to the infobubble before it starts sliding |
43 // off-screen. | 47 // off-screen. |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 577 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); |
574 params.transparent = true; | 578 params.transparent = true; |
575 params.accept_events = false; | 579 params.accept_events = false; |
576 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 580 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
577 params.parent_widget = frame; | 581 params.parent_widget = frame; |
578 popup_->Init(params); | 582 popup_->Init(params); |
579 // We do our own animation and don't want any from the system. | 583 // We do our own animation and don't want any from the system. |
580 popup_->SetVisibilityChangedAnimationsEnabled(false); | 584 popup_->SetVisibilityChangedAnimationsEnabled(false); |
581 popup_->SetOpacity(0x00); | 585 popup_->SetOpacity(0x00); |
582 popup_->SetContentsView(view_); | 586 popup_->SetContentsView(view_); |
| 587 #if defined(USE_ASH) |
| 588 ash::SetIgnoredByShelf(popup_->GetNativeWindow(), true); |
| 589 #endif |
583 Reposition(); | 590 Reposition(); |
584 } | 591 } |
585 } | 592 } |
586 | 593 |
587 void StatusBubbleViews::Reposition() { | 594 void StatusBubbleViews::Reposition() { |
588 if (popup_.get()) { | 595 if (popup_.get()) { |
589 gfx::Point top_left; | 596 gfx::Point top_left; |
590 views::View::ConvertPointToScreen(base_view_, &top_left); | 597 views::View::ConvertPointToScreen(base_view_, &top_left); |
591 | 598 |
592 popup_->SetBounds(gfx::Rect(top_left.x() + position_.x(), | 599 popup_->SetBounds(gfx::Rect(top_left.x() + position_.x(), |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 void StatusBubbleViews::SetBubbleWidth(int width) { | 845 void StatusBubbleViews::SetBubbleWidth(int width) { |
839 size_.set_width(width); | 846 size_.set_width(width); |
840 SetBounds(original_position_.x(), original_position_.y(), | 847 SetBounds(original_position_.x(), original_position_.y(), |
841 size_.width(), size_.height()); | 848 size_.width(), size_.height()); |
842 } | 849 } |
843 | 850 |
844 void StatusBubbleViews::CancelExpandTimer() { | 851 void StatusBubbleViews::CancelExpandTimer() { |
845 if (expand_timer_factory_.HasWeakPtrs()) | 852 if (expand_timer_factory_.HasWeakPtrs()) |
846 expand_timer_factory_.InvalidateWeakPtrs(); | 853 expand_timer_factory_.InvalidateWeakPtrs(); |
847 } | 854 } |
OLD | NEW |