Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: ash/display/shared_display_edge_indicator.cc

Issue 1924703002: Rename gfx::Display/Screen to display::Display/Screen in ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
11 #include "ui/aura/window_event_dispatcher.h" 11 #include "ui/aura/window_event_dispatcher.h"
12 #include "ui/display/display.h"
13 #include "ui/display/screen.h"
12 #include "ui/gfx/animation/throb_animation.h" 14 #include "ui/gfx/animation/throb_animation.h"
13 #include "ui/gfx/canvas.h" 15 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/display.h"
15 #include "ui/gfx/screen.h"
16 #include "ui/views/view.h" 16 #include "ui/views/view.h"
17 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
18 18
19 namespace ash { 19 namespace ash {
20 namespace { 20 namespace {
21 21
22 const int kIndicatorAnimationDurationMs = 1000; 22 const int kIndicatorAnimationDurationMs = 1000;
23 23
24 class IndicatorView : public views::View { 24 class IndicatorView : public views::View {
25 public: 25 public:
(...skipping 23 matching lines...) Expand all
49 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 49 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
50 params.keep_on_top = true; 50 params.keep_on_top = true;
51 // We set the context to the primary root window; this is OK because the ash 51 // We set the context to the primary root window; this is OK because the ash
52 // stacking controller will still place us in the correct RootWindow. 52 // stacking controller will still place us in the correct RootWindow.
53 params.context = Shell::GetPrimaryRootWindow(); 53 params.context = Shell::GetPrimaryRootWindow();
54 widget->set_focus_on_creation(false); 54 widget->set_focus_on_creation(false);
55 widget->Init(params); 55 widget->Init(params);
56 widget->SetVisibilityChangedAnimationsEnabled(false); 56 widget->SetVisibilityChangedAnimationsEnabled(false);
57 widget->GetNativeWindow()->SetName("SharedEdgeIndicator"); 57 widget->GetNativeWindow()->SetName("SharedEdgeIndicator");
58 widget->SetContentsView(contents_view); 58 widget->SetContentsView(contents_view);
59 gfx::Display display = gfx::Screen::GetScreen()->GetDisplayMatching(bounds); 59 display::Display display =
60 display::Screen::GetScreen()->GetDisplayMatching(bounds);
60 aura::Window* window = widget->GetNativeWindow(); 61 aura::Window* window = widget->GetNativeWindow();
61 aura::client::ScreenPositionClient* screen_position_client = 62 aura::client::ScreenPositionClient* screen_position_client =
62 aura::client::GetScreenPositionClient(window->GetRootWindow()); 63 aura::client::GetScreenPositionClient(window->GetRootWindow());
63 screen_position_client->SetBounds(window, bounds, display); 64 screen_position_client->SetBounds(window, bounds, display);
64 widget->Show(); 65 widget->Show();
65 return widget; 66 return widget;
66 } 67 }
67 68
68 } // namespace 69 } // namespace
69 70
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 int value = animation->CurrentValueBetween(0, 255); 104 int value = animation->CurrentValueBetween(0, 255);
104 SkColor color = SkColorSetARGB(0xFF, value, value, value); 105 SkColor color = SkColorSetARGB(0xFF, value, value, value);
105 if (src_indicator_) 106 if (src_indicator_)
106 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); 107 static_cast<IndicatorView*>(src_indicator_)->SetColor(color);
107 if (dst_indicator_) 108 if (dst_indicator_)
108 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); 109 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color);
109 110
110 } 111 }
111 112
112 } // namespace ash 113 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/shared_display_edge_indicator.h ('k') | ash/display/unified_mouse_warp_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698