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

Side by Side Diff: ui/views/mus/window_tree_host_mus.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « ui/views/mus/views_mus_test_suite.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/views/mus/window_tree_host_mus.h" 5 #include "ui/views/mus/window_tree_host_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "services/ui/public/cpp/window.h" 8 #include "services/ui/public/cpp/window.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 20 matching lines...) Expand all
31 #if defined(OS_WIN) || defined(OS_ANDROID) 31 #if defined(OS_WIN) || defined(OS_ANDROID)
32 gfx::AcceleratedWidget accelerated_widget = 32 gfx::AcceleratedWidget accelerated_widget =
33 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); 33 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
34 #else 34 #else
35 gfx::AcceleratedWidget accelerated_widget = 35 gfx::AcceleratedWidget accelerated_widget =
36 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); 36 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
37 #endif 37 #endif
38 // TODO(markdittmer): Use correct device-scale-factor from |window|. 38 // TODO(markdittmer): Use correct device-scale-factor from |window|.
39 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); 39 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f);
40 40
41 SetPlatformWindow(base::WrapUnique(new ui::StubWindow( 41 SetPlatformWindow(base::MakeUnique<ui::StubWindow>(
42 this, 42 this,
43 false))); // Do not advertise accelerated widget; already set manually. 43 false)); // Do not advertise accelerated widget; already set manually.
44 44
45 compositor()->SetWindow(window); 45 compositor()->SetWindow(window);
46 46
47 // Initialize the stub platform window bounds to those of the ui::Window. 47 // Initialize the stub platform window bounds to those of the ui::Window.
48 platform_window()->SetBounds(window->bounds()); 48 platform_window()->SetBounds(window->bounds());
49 49
50 // The location of events is already transformed, and there is no way to 50 // The location of events is already transformed, and there is no way to
51 // correctly determine the reverse transform. So, don't attempt to transform 51 // correctly determine the reverse transform. So, don't attempt to transform
52 // event locations, else the root location is wrong. 52 // event locations, else the root location is wrong.
53 // TODO(sky): we need to transform for device scale though. 53 // TODO(sky): we need to transform for device scale though.
(...skipping 30 matching lines...) Expand all
84 if (native_widget_) 84 if (native_widget_)
85 native_widget_->OnActivationChanged(active); 85 native_widget_->OnActivationChanged(active);
86 WindowTreeHostPlatform::OnActivationChanged(active); 86 WindowTreeHostPlatform::OnActivationChanged(active);
87 } 87 }
88 88
89 void WindowTreeHostMus::OnCloseRequest() { 89 void WindowTreeHostMus::OnCloseRequest() {
90 OnHostCloseRequested(); 90 OnHostCloseRequested();
91 } 91 }
92 92
93 } // namespace views 93 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/views_mus_test_suite.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698