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