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 17 matching lines...) Expand all Loading... |
28 #include "ui/gfx/skia_util.h" | 28 #include "ui/gfx/skia_util.h" |
29 #include "ui/gfx/text_elider.h" | 29 #include "ui/gfx/text_elider.h" |
30 #include "ui/native_theme/native_theme.h" | 30 #include "ui/native_theme/native_theme.h" |
31 #include "ui/views/controls/label.h" | 31 #include "ui/views/controls/label.h" |
32 #include "ui/views/controls/scrollbar/native_scroll_bar.h" | 32 #include "ui/views/controls/scrollbar/native_scroll_bar.h" |
33 #include "ui/views/widget/root_view.h" | 33 #include "ui/views/widget/root_view.h" |
34 #include "ui/views/widget/widget.h" | 34 #include "ui/views/widget/widget.h" |
35 #include "url/gurl.h" | 35 #include "url/gurl.h" |
36 | 36 |
37 #if defined(USE_ASH) | 37 #if defined(USE_ASH) |
38 #include "ash/wm/window_settings.h" | 38 #include "ash/wm/window_state.h" |
39 #endif | 39 #endif |
40 | 40 |
41 // The alpha and color of the bubble's shadow. | 41 // The alpha and color of the bubble's shadow. |
42 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); | 42 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); |
43 | 43 |
44 // The roundedness of the edges of our bubble. | 44 // The roundedness of the edges of our bubble. |
45 static const int kBubbleCornerRadius = 4; | 45 static const int kBubbleCornerRadius = 4; |
46 | 46 |
47 // How close the mouse can get to the infobubble before it starts sliding | 47 // How close the mouse can get to the infobubble before it starts sliding |
48 // off-screen. | 48 // off-screen. |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 params.accept_events = false; | 576 params.accept_events = false; |
577 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 577 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
578 params.parent = frame->GetNativeView(); | 578 params.parent = frame->GetNativeView(); |
579 params.context = frame->GetNativeView(); | 579 params.context = frame->GetNativeView(); |
580 popup_->Init(params); | 580 popup_->Init(params); |
581 // We do our own animation and don't want any from the system. | 581 // We do our own animation and don't want any from the system. |
582 popup_->SetVisibilityChangedAnimationsEnabled(false); | 582 popup_->SetVisibilityChangedAnimationsEnabled(false); |
583 popup_->SetOpacity(0x00); | 583 popup_->SetOpacity(0x00); |
584 popup_->SetContentsView(view_); | 584 popup_->SetContentsView(view_); |
585 #if defined(USE_ASH) | 585 #if defined(USE_ASH) |
586 ash::wm::GetWindowSettings(popup_->GetNativeWindow())-> | 586 ash::wm::GetWindowState(popup_->GetNativeWindow())-> |
587 set_ignored_by_shelf(true); | 587 set_ignored_by_shelf(true); |
588 #endif | 588 #endif |
589 Reposition(); | 589 Reposition(); |
590 } | 590 } |
591 } | 591 } |
592 | 592 |
593 void StatusBubbleViews::Reposition() { | 593 void StatusBubbleViews::Reposition() { |
594 if (popup_.get()) { | 594 if (popup_.get()) { |
595 gfx::Point top_left; | 595 gfx::Point top_left; |
596 views::View::ConvertPointToScreen(base_view_, &top_left); | 596 views::View::ConvertPointToScreen(base_view_, &top_left); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 void StatusBubbleViews::SetBubbleWidth(int width) { | 847 void StatusBubbleViews::SetBubbleWidth(int width) { |
848 size_.set_width(width); | 848 size_.set_width(width); |
849 SetBounds(original_position_.x(), original_position_.y(), | 849 SetBounds(original_position_.x(), original_position_.y(), |
850 size_.width(), size_.height()); | 850 size_.width(), size_.height()); |
851 } | 851 } |
852 | 852 |
853 void StatusBubbleViews::CancelExpandTimer() { | 853 void StatusBubbleViews::CancelExpandTimer() { |
854 if (expand_timer_factory_.HasWeakPtrs()) | 854 if (expand_timer_factory_.HasWeakPtrs()) |
855 expand_timer_factory_.InvalidateWeakPtrs(); | 855 expand_timer_factory_.InvalidateWeakPtrs(); |
856 } | 856 } |
OLD | NEW |