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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 50 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
51 params.keep_on_top = true; | 51 params.keep_on_top = true; |
52 // We set the context to the primary root window; this is OK because the ash | 52 // We set the context to the primary root window; this is OK because the ash |
53 // stacking controller will still place us in the correct RootWindow. | 53 // stacking controller will still place us in the correct RootWindow. |
54 params.context = Shell::GetPrimaryRootWindow(); | 54 params.context = Shell::GetPrimaryRootWindow(); |
55 widget->set_focus_on_creation(false); | 55 widget->set_focus_on_creation(false); |
56 widget->Init(params); | 56 widget->Init(params); |
57 widget->SetVisibilityChangedAnimationsEnabled(false); | 57 widget->SetVisibilityChangedAnimationsEnabled(false); |
58 widget->GetNativeWindow()->SetName("SharedEdgeIndicator"); | 58 widget->GetNativeWindow()->SetName("SharedEdgeIndicator"); |
59 widget->SetContentsView(contents_view); | 59 widget->SetContentsView(contents_view); |
60 gfx::Display display = Shell::GetScreen()->GetDisplayMatching(bounds); | 60 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(bounds); |
61 aura::Window* window = widget->GetNativeWindow(); | 61 aura::Window* window = widget->GetNativeWindow(); |
62 aura::client::ScreenPositionClient* screen_position_client = | 62 aura::client::ScreenPositionClient* screen_position_client = |
63 aura::client::GetScreenPositionClient(window->GetRootWindow()); | 63 aura::client::GetScreenPositionClient(window->GetRootWindow()); |
64 screen_position_client->SetBounds(window, bounds, display); | 64 screen_position_client->SetBounds(window, bounds, display); |
65 widget->Show(); | 65 widget->Show(); |
66 return widget; | 66 return widget; |
67 } | 67 } |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 | 70 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 int value = animation->CurrentValueBetween(0, 255); | 104 int value = animation->CurrentValueBetween(0, 255); |
105 SkColor color = SkColorSetARGB(0xFF, value, value, value); | 105 SkColor color = SkColorSetARGB(0xFF, value, value, value); |
106 if (src_indicator_) | 106 if (src_indicator_) |
107 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); | 107 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); |
108 if (dst_indicator_) | 108 if (dst_indicator_) |
109 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); | 109 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); |
110 | 110 |
111 } | 111 } |
112 | 112 |
113 } // namespace ash | 113 } // namespace ash |
OLD | NEW |