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

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

Issue 1953293004: PlatformWindowMus::SetBounds to NativeWidgetMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cast to PlatformWindowDelegate for OnBoundsChanged 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
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | no next file » | 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/platform_window_mus.h" 5 #include "ui/views/mus/platform_window_mus.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/bitmap_uploader/bitmap_uploader.h" 9 #include "components/bitmap_uploader/bitmap_uploader.h"
10 #include "components/mus/public/cpp/property_type_converters.h" 10 #include "components/mus/public/cpp/property_type_converters.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 void PlatformWindowMus::Hide() { 123 void PlatformWindowMus::Hide() {
124 mus_window_->SetVisible(false); 124 mus_window_->SetVisible(false);
125 } 125 }
126 126
127 void PlatformWindowMus::Close() { 127 void PlatformWindowMus::Close() {
128 NOTIMPLEMENTED(); 128 NOTIMPLEMENTED();
129 } 129 }
130 130
131 void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) { 131 void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) {}
132 mus_window_->SetBounds(bounds);
133 }
134 132
135 gfx::Rect PlatformWindowMus::GetBounds() { 133 gfx::Rect PlatformWindowMus::GetBounds() {
136 return mus_window_->bounds(); 134 return mus_window_->bounds();
137 } 135 }
138 136
139 void PlatformWindowMus::SetTitle(const base::string16& title) { 137 void PlatformWindowMus::SetTitle(const base::string16& title) {
140 NOTIMPLEMENTED(); 138 NOTIMPLEMENTED();
141 } 139 }
142 140
143 void PlatformWindowMus::SetCapture() { 141 void PlatformWindowMus::SetCapture() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 weak_factory_.reset(new base::WeakPtrFactory<PlatformWindowMus>(this)); 191 weak_factory_.reset(new base::WeakPtrFactory<PlatformWindowMus>(this));
194 base::WeakPtr<PlatformWindowMus> weak_ptr = weak_factory_->GetWeakPtr(); 192 base::WeakPtr<PlatformWindowMus> weak_ptr = weak_factory_->GetWeakPtr();
195 #endif 193 #endif
196 delegate_->OnClosed(); 194 delegate_->OnClosed();
197 // |this| has been destroyed at this point. 195 // |this| has been destroyed at this point.
198 #ifndef NDEBUG 196 #ifndef NDEBUG
199 DCHECK(!weak_ptr); 197 DCHECK(!weak_ptr);
200 #endif 198 #endif
201 } 199 }
202 200
203 void PlatformWindowMus::OnWindowBoundsChanged(mus::Window* window,
204 const gfx::Rect& old_bounds,
205 const gfx::Rect& new_bounds) {
206 delegate_->OnBoundsChanged(new_bounds);
207 }
208
209 void PlatformWindowMus::OnWindowFocusChanged(mus::Window* gained_focus, 201 void PlatformWindowMus::OnWindowFocusChanged(mus::Window* gained_focus,
210 mus::Window* lost_focus) { 202 mus::Window* lost_focus) {
211 if (gained_focus == mus_window_) 203 if (gained_focus == mus_window_)
212 delegate_->OnActivationChanged(true); 204 delegate_->OnActivationChanged(true);
213 else if (lost_focus == mus_window_) 205 else if (lost_focus == mus_window_)
214 delegate_->OnActivationChanged(false); 206 delegate_->OnActivationChanged(false);
215 } 207 }
216 208
217 void PlatformWindowMus::OnWindowPredefinedCursorChanged( 209 void PlatformWindowMus::OnWindowPredefinedCursorChanged(
218 mus::Window* window, 210 mus::Window* window,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 261
270 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in); 262 std::unique_ptr<ui::Event> event = ui::Event::Clone(event_in);
271 delegate_->DispatchEvent(event.get()); 263 delegate_->DispatchEvent(event.get());
272 // NOTE: |this| may be deleted. 264 // NOTE: |this| may be deleted.
273 265
274 ack_handler.set_handled(event->handled()); 266 ack_handler.set_handled(event->handled());
275 // |ack_handler| acks the event on destruction if necessary. 267 // |ack_handler| acks the event on destruction if necessary.
276 } 268 }
277 269
278 } // namespace views 270 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698