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 "ash/display/shared_display_edge_indicator.h" | 5 #include "ash/display/shared_display_edge_indicator.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/coordinate_conversion.h" | 9 #include "ash/wm/coordinate_conversion.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 private: | 42 private: |
43 SkColor color_; | 43 SkColor color_; |
44 DISALLOW_COPY_AND_ASSIGN(IndicatorView); | 44 DISALLOW_COPY_AND_ASSIGN(IndicatorView); |
45 }; | 45 }; |
46 | 46 |
47 views::Widget* CreateWidget(const gfx::Rect& bounds, | 47 views::Widget* CreateWidget(const gfx::Rect& bounds, |
48 views::View* contents_view) { | 48 views::View* contents_view) { |
49 views::Widget* widget = new views::Widget; | 49 views::Widget* widget = new views::Widget; |
50 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 50 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
51 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 51 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
52 params.can_activate = false; | |
53 params.keep_on_top = true; | 52 params.keep_on_top = true; |
54 // We set the context to the primary root window; this is OK because the ash | 53 // We set the context to the primary root window; this is OK because the ash |
55 // stacking controller will still place us in the correct RootWindow. | 54 // stacking controller will still place us in the correct RootWindow. |
56 params.context = Shell::GetPrimaryRootWindow(); | 55 params.context = Shell::GetPrimaryRootWindow(); |
57 widget->set_focus_on_creation(false); | 56 widget->set_focus_on_creation(false); |
58 widget->Init(params); | 57 widget->Init(params); |
59 widget->SetVisibilityChangedAnimationsEnabled(false); | 58 widget->SetVisibilityChangedAnimationsEnabled(false); |
60 widget->GetNativeWindow()->SetName("SharedEdgeIndicator"); | 59 widget->GetNativeWindow()->SetName("SharedEdgeIndicator"); |
61 widget->SetContentsView(contents_view); | 60 widget->SetContentsView(contents_view); |
62 gfx::Display display = Shell::GetScreen()->GetDisplayMatching(bounds); | 61 gfx::Display display = Shell::GetScreen()->GetDisplayMatching(bounds); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 int value = animation->CurrentValueBetween(0, 255); | 105 int value = animation->CurrentValueBetween(0, 255); |
107 SkColor color = SkColorSetARGB(0xFF, value, value, value); | 106 SkColor color = SkColorSetARGB(0xFF, value, value, value); |
108 if (src_indicator_) | 107 if (src_indicator_) |
109 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); | 108 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); |
110 if (dst_indicator_) | 109 if (dst_indicator_) |
111 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); | 110 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); |
112 | 111 |
113 } | 112 } |
114 | 113 |
115 } // namespace ash | 114 } // namespace ash |
OLD | NEW |