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 25 matching lines...) Expand all Loading... |
36 #include "ui/views/controls/scrollbar/native_scroll_bar.h" | 36 #include "ui/views/controls/scrollbar/native_scroll_bar.h" |
37 #include "ui/views/widget/root_view.h" | 37 #include "ui/views/widget/root_view.h" |
38 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
40 | 40 |
41 #if defined(USE_ASH) | 41 #if defined(USE_ASH) |
42 #include "ash/common/wm/window_state.h" | 42 #include "ash/common/wm/window_state.h" |
43 #include "ash/wm/window_state_aura.h" | 43 #include "ash/wm/window_state_aura.h" |
44 #endif | 44 #endif |
45 | 45 |
46 #if defined(MOJO_SHELL_CLIENT) | 46 #if defined(USE_AURA) |
47 #include "services/ui/public/cpp/property_type_converters.h" | 47 #include "services/ui/public/cpp/property_type_converters.h" |
48 #include "services/ui/public/interfaces/window_manager.mojom.h" | 48 #include "services/ui/public/interfaces/window_manager.mojom.h" |
49 #endif | 49 #endif |
50 | 50 |
51 // The alpha and color of the bubble's shadow. | 51 // The alpha and color of the bubble's shadow. |
52 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); | 52 static const SkColor kShadowColor = SkColorSetARGB(30, 0, 0, 0); |
53 | 53 |
54 // The roundedness of the edges of our bubble. | 54 // The roundedness of the edges of our bubble. |
55 static const int kBubbleCornerRadius = 4; | 55 static const int kBubbleCornerRadius = 4; |
56 | 56 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // On Windows use the software compositor to ensure that we don't block | 600 // On Windows use the software compositor to ensure that we don't block |
601 // the UI thread blocking issue during command buffer creation. We can | 601 // the UI thread blocking issue during command buffer creation. We can |
602 // revert this change once http://crbug.com/125248 is fixed. | 602 // revert this change once http://crbug.com/125248 is fixed. |
603 params.force_software_compositing = true; | 603 params.force_software_compositing = true; |
604 #endif | 604 #endif |
605 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 605 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
606 params.accept_events = false; | 606 params.accept_events = false; |
607 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 607 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
608 params.parent = frame->GetNativeView(); | 608 params.parent = frame->GetNativeView(); |
609 params.context = frame->GetNativeWindow(); | 609 params.context = frame->GetNativeWindow(); |
610 #if defined(MOJO_SHELL_CLIENT) | 610 #if defined(USE_AURA) |
611 params.mus_properties | 611 params.mus_properties |
612 [ui::mojom::WindowManager::kWindowIgnoredByShelf_Property] = | 612 [ui::mojom::WindowManager::kWindowIgnoredByShelf_Property] = |
613 mojo::ConvertTo<std::vector<uint8_t>>(true); | 613 mojo::ConvertTo<std::vector<uint8_t>>(true); |
614 #endif | 614 #endif |
615 popup_->Init(params); | 615 popup_->Init(params); |
616 // We do our own animation and don't want any from the system. | 616 // We do our own animation and don't want any from the system. |
617 popup_->SetVisibilityChangedAnimationsEnabled(false); | 617 popup_->SetVisibilityChangedAnimationsEnabled(false); |
618 popup_->SetOpacity(0.f); | 618 popup_->SetOpacity(0.f); |
619 popup_->SetContentsView(view_); | 619 popup_->SetContentsView(view_); |
620 #if defined(USE_ASH) | 620 #if defined(USE_ASH) |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 void StatusBubbleViews::SetBubbleWidth(int width) { | 901 void StatusBubbleViews::SetBubbleWidth(int width) { |
902 size_.set_width(width); | 902 size_.set_width(width); |
903 SetBounds(original_position_.x(), original_position_.y(), | 903 SetBounds(original_position_.x(), original_position_.y(), |
904 size_.width(), size_.height()); | 904 size_.width(), size_.height()); |
905 } | 905 } |
906 | 906 |
907 void StatusBubbleViews::CancelExpandTimer() { | 907 void StatusBubbleViews::CancelExpandTimer() { |
908 if (expand_timer_factory_.HasWeakPtrs()) | 908 if (expand_timer_factory_.HasWeakPtrs()) |
909 expand_timer_factory_.InvalidateWeakPtrs(); | 909 expand_timer_factory_.InvalidateWeakPtrs(); |
910 } | 910 } |
OLD | NEW |