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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/themes/theme_properties.h" | 18 #include "chrome/browser/themes/theme_properties.h" |
19 #include "components/url_formatter/elide_url.h" | 19 #include "components/url_formatter/elide_url.h" |
20 #include "components/url_formatter/url_formatter.h" | 20 #include "components/url_formatter/url_formatter.h" |
21 #include "services/service_manager/runner/common/client_util.h" | |
22 #include "third_party/skia/include/core/SkPaint.h" | 21 #include "third_party/skia/include/core/SkPaint.h" |
23 #include "third_party/skia/include/core/SkPath.h" | 22 #include "third_party/skia/include/core/SkPath.h" |
24 #include "third_party/skia/include/pathops/SkPathOps.h" | 23 #include "third_party/skia/include/pathops/SkPathOps.h" |
25 #include "ui/base/theme_provider.h" | 24 #include "ui/base/theme_provider.h" |
26 #include "ui/display/display.h" | 25 #include "ui/display/display.h" |
27 #include "ui/display/screen.h" | 26 #include "ui/display/screen.h" |
28 #include "ui/gfx/animation/animation_delegate.h" | 27 #include "ui/gfx/animation/animation_delegate.h" |
29 #include "ui/gfx/animation/linear_animation.h" | 28 #include "ui/gfx/animation/linear_animation.h" |
30 #include "ui/gfx/canvas.h" | 29 #include "ui/gfx/canvas.h" |
31 #include "ui/gfx/font_list.h" | 30 #include "ui/gfx/font_list.h" |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 params.mus_properties | 656 params.mus_properties |
658 [ui::mojom::WindowManager::kWindowIgnoredByShelf_Property] = | 657 [ui::mojom::WindowManager::kWindowIgnoredByShelf_Property] = |
659 mojo::ConvertTo<std::vector<uint8_t>>(true); | 658 mojo::ConvertTo<std::vector<uint8_t>>(true); |
660 #endif | 659 #endif |
661 popup_->Init(params); | 660 popup_->Init(params); |
662 // We do our own animation and don't want any from the system. | 661 // We do our own animation and don't want any from the system. |
663 popup_->SetVisibilityChangedAnimationsEnabled(false); | 662 popup_->SetVisibilityChangedAnimationsEnabled(false); |
664 popup_->SetOpacity(0.f); | 663 popup_->SetOpacity(0.f); |
665 popup_->SetContentsView(view_); | 664 popup_->SetContentsView(view_); |
666 #if defined(USE_ASH) | 665 #if defined(USE_ASH) |
667 // TODO: http://crbug.com/671729 convert to WindowProperty (and then can | 666 ash::wm::GetWindowState(popup_->GetNativeWindow())-> |
668 // remove explicit kWindowIgnoredByShelf_Property above and make this ifdef | 667 set_ignored_by_shelf(true); |
669 // USE_AURA). | |
670 if (!service_manager::ServiceManagerIsRemote()) { | |
671 ash::wm::GetWindowState(popup_->GetNativeWindow()) | |
672 ->set_ignored_by_shelf(true); | |
673 } | |
674 #endif | 668 #endif |
675 RepositionPopup(); | 669 RepositionPopup(); |
676 } | 670 } |
677 } | 671 } |
678 | 672 |
679 void StatusBubbleViews::Reposition() { | 673 void StatusBubbleViews::Reposition() { |
680 // Overlap the client edge that's shown in restored mode, or when there is no | 674 // Overlap the client edge that's shown in restored mode, or when there is no |
681 // client edge this makes the bubble snug with the corner of the window. | 675 // client edge this makes the bubble snug with the corner of the window. |
682 int overlap = kShadowThickness; | 676 int overlap = kShadowThickness; |
683 int height = GetPreferredSize().height(); | 677 int height = GetPreferredSize().height(); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 void StatusBubbleViews::SetBubbleWidth(int width) { | 945 void StatusBubbleViews::SetBubbleWidth(int width) { |
952 size_.set_width(width); | 946 size_.set_width(width); |
953 SetBounds(original_position_.x(), original_position_.y(), | 947 SetBounds(original_position_.x(), original_position_.y(), |
954 size_.width(), size_.height()); | 948 size_.width(), size_.height()); |
955 } | 949 } |
956 | 950 |
957 void StatusBubbleViews::CancelExpandTimer() { | 951 void StatusBubbleViews::CancelExpandTimer() { |
958 if (expand_timer_factory_.HasWeakPtrs()) | 952 if (expand_timer_factory_.HasWeakPtrs()) |
959 expand_timer_factory_.InvalidateWeakPtrs(); | 953 expand_timer_factory_.InvalidateWeakPtrs(); |
960 } | 954 } |
OLD | NEW |