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

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

Issue 2579883002: Scale bounds in aura-mus client-lib and NativeWidgetMus in hdpi mode. (Closed)
Patch Set: change a comment about pixels Created 4 years 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 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/aura/mus/window_tree_host_mus.h" 5 #include "ui/aura/mus/window_tree_host_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/mus/input_method_mus.h" 9 #include "ui/aura/mus/input_method_mus.h"
10 #include "ui/aura/mus/window_port_mus.h" 10 #include "ui/aura/mus/window_port_mus.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t 58 // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t
59 // has this property. 59 // has this property.
60 #if defined(OS_WIN) || defined(OS_ANDROID) 60 #if defined(OS_WIN) || defined(OS_ANDROID)
61 accelerated_widget = 61 accelerated_widget =
62 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); 62 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
63 #else 63 #else
64 accelerated_widget = 64 accelerated_widget =
65 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); 65 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
66 #endif 66 #endif
67 } 67 }
68 // TODO(markdittmer): Use correct device-scale-factor from |window|. 68 OnAcceleratedWidgetAvailable(accelerated_widget,
69 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); 69 display::Screen::GetScreen()
70 ->GetDisplayNearestWindow(window())
sadrul 2016/12/21 16:22:44 Does GetDisplayNearestWindow() return the correct
riajiang 2016/12/21 17:48:33 As discussed offline, changed to use |display_id_|
71 .device_scale_factor());
70 72
71 delegate_->OnWindowTreeHostCreated(this); 73 delegate_->OnWindowTreeHostCreated(this);
72 74
73 SetPlatformWindow(base::MakeUnique<ui::StubWindow>( 75 SetPlatformWindow(base::MakeUnique<ui::StubWindow>(
74 this, 76 this,
75 false)); // Do not advertise accelerated widget; already set manually. 77 false)); // Do not advertise accelerated widget; already set manually.
76 78
77 input_method_ = base::MakeUnique<InputMethodMus>(this, window()); 79 input_method_ = base::MakeUnique<InputMethodMus>(this, window());
78 input_method_->Init(window_tree_client->connector()); 80 input_method_->Init(window_tree_client->connector());
79 SetSharedInputMethod(input_method_.get()); 81 SetSharedInputMethod(input_method_.get());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void WindowTreeHostMus::OnCloseRequest() { 160 void WindowTreeHostMus::OnCloseRequest() {
159 OnHostCloseRequested(); 161 OnHostCloseRequested();
160 } 162 }
161 163
162 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { 164 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() {
163 // TODO: This should read the profile from mus. crbug.com/647510 165 // TODO: This should read the profile from mus. crbug.com/647510
164 return gfx::ICCProfile(); 166 return gfx::ICCProfile();
165 } 167 }
166 168
167 } // namespace aura 169 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698