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

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

Issue 2524873002: Rename WindowTreeHost G|SetBounds to indicate they are in pixels. (Closed)
Patch Set: rebase 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
« no previous file with comments | « ui/aura/mus/window_tree_host_mus.h ('k') | ui/aura/test/aura_test_helper.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/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 display::Screen::GetScreen()->GetPrimaryDisplay().id(), 92 display::Screen::GetScreen()->GetPrimaryDisplay().id(),
93 properties) {} 93 properties) {}
94 94
95 WindowTreeHostMus::~WindowTreeHostMus() { 95 WindowTreeHostMus::~WindowTreeHostMus() {
96 DestroyCompositor(); 96 DestroyCompositor();
97 DestroyDispatcher(); 97 DestroyDispatcher();
98 } 98 }
99 99
100 void WindowTreeHostMus::SetBoundsFromServer(const gfx::Rect& bounds) { 100 void WindowTreeHostMus::SetBoundsFromServer(const gfx::Rect& bounds) {
101 base::AutoReset<bool> resetter(&in_set_bounds_from_server_, true); 101 base::AutoReset<bool> resetter(&in_set_bounds_from_server_, true);
102 SetBounds(bounds); 102 SetBoundsInPixels(bounds);
103 } 103 }
104 104
105 void WindowTreeHostMus::SetClientArea(const gfx::Insets& insets) { 105 void WindowTreeHostMus::SetClientArea(const gfx::Insets& insets) {
106 delegate_->OnWindowTreeHostClientAreaWillChange(this, insets, 106 delegate_->OnWindowTreeHostClientAreaWillChange(this, insets,
107 std::vector<gfx::Rect>()); 107 std::vector<gfx::Rect>());
108 } 108 }
109 109
110 void WindowTreeHostMus::SetHitTestMask(const base::Optional<gfx::Rect>& rect) { 110 void WindowTreeHostMus::SetHitTestMask(const base::Optional<gfx::Rect>& rect) {
111 delegate_->OnWindowTreeHostHitTestMaskWillChange(this, rect); 111 delegate_->OnWindowTreeHostHitTestMaskWillChange(this, rect);
112 } 112 }
(...skipping 10 matching lines...) Expand all
123 void WindowTreeHostMus::ShowImpl() { 123 void WindowTreeHostMus::ShowImpl() {
124 WindowTreeHostPlatform::ShowImpl(); 124 WindowTreeHostPlatform::ShowImpl();
125 window()->Show(); 125 window()->Show();
126 } 126 }
127 127
128 void WindowTreeHostMus::HideImpl() { 128 void WindowTreeHostMus::HideImpl() {
129 WindowTreeHostPlatform::HideImpl(); 129 WindowTreeHostPlatform::HideImpl();
130 window()->Hide(); 130 window()->Hide();
131 } 131 }
132 132
133 void WindowTreeHostMus::SetBounds(const gfx::Rect& bounds) { 133 void WindowTreeHostMus::SetBoundsInPixels(const gfx::Rect& bounds) {
134 if (!in_set_bounds_from_server_) 134 if (!in_set_bounds_from_server_)
135 delegate_->OnWindowTreeHostBoundsWillChange(this, bounds); 135 delegate_->OnWindowTreeHostBoundsWillChange(this, bounds);
136 WindowTreeHostPlatform::SetBounds(bounds); 136 WindowTreeHostPlatform::SetBoundsInPixels(bounds);
137 } 137 }
138 138
139 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { 139 void WindowTreeHostMus::DispatchEvent(ui::Event* event) {
140 DCHECK(!event->IsKeyEvent()); 140 DCHECK(!event->IsKeyEvent());
141 WindowTreeHostPlatform::DispatchEvent(event); 141 WindowTreeHostPlatform::DispatchEvent(event);
142 } 142 }
143 143
144 void WindowTreeHostMus::OnClosed() { 144 void WindowTreeHostMus::OnClosed() {
145 } 145 }
146 146
147 void WindowTreeHostMus::OnActivationChanged(bool active) { 147 void WindowTreeHostMus::OnActivationChanged(bool active) {
148 if (active) 148 if (active)
149 GetInputMethod()->OnFocus(); 149 GetInputMethod()->OnFocus();
150 else 150 else
151 GetInputMethod()->OnBlur(); 151 GetInputMethod()->OnBlur();
152 WindowTreeHostPlatform::OnActivationChanged(active); 152 WindowTreeHostPlatform::OnActivationChanged(active);
153 } 153 }
154 154
155 void WindowTreeHostMus::OnCloseRequest() { 155 void WindowTreeHostMus::OnCloseRequest() {
156 OnHostCloseRequested(); 156 OnHostCloseRequested();
157 } 157 }
158 158
159 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { 159 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() {
160 // TODO: This should read the profile from mus. crbug.com/647510 160 // TODO: This should read the profile from mus. crbug.com/647510
161 return gfx::ICCProfile(); 161 return gfx::ICCProfile();
162 } 162 }
163 163
164 } // namespace aura 164 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_host_mus.h ('k') | ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698