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

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

Issue 1975873002: Move remaining mus::WindowObserver lifecycle callbacks from PlatformWindowMus to NativeWidgetMus::M… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « no previous file | ui/views/mus/platform_window_mus.h » ('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/native_widget_mus.h" 5 #include "ui/views/mus/native_widget_mus.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "components/mus/public/cpp/property_type_converters.h" 9 #include "components/mus/public/cpp/property_type_converters.h"
10 #include "components/mus/public/cpp/window.h" 10 #include "components/mus/public/cpp/window.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 case mus::mojom::ShowState::DOCKED: 355 case mus::mojom::ShowState::DOCKED:
356 // TODO(sky): support docked. 356 // TODO(sky): support docked.
357 state = ui::PLATFORM_WINDOW_STATE_NORMAL; 357 state = ui::PLATFORM_WINDOW_STATE_NORMAL;
358 break; 358 break;
359 case mus::mojom::ShowState::FULLSCREEN: 359 case mus::mojom::ShowState::FULLSCREEN:
360 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN; 360 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN;
361 break; 361 break;
362 } 362 }
363 platform_window_delegate()->OnWindowStateChanged(state); 363 platform_window_delegate()->OnWindowStateChanged(state);
364 } 364 }
365 void OnWindowDestroyed(mus::Window* window) override {
366 DCHECK_EQ(mus_window(), window);
367 platform_window_delegate()->OnClosed();
368 }
369 void OnWindowFocusChanged(mus::Window* gained_focus,
370 mus::Window* lost_focus) override {
371 if (gained_focus == mus_window())
372 platform_window_delegate()->OnActivationChanged(true);
373 else if (lost_focus == mus_window())
374 platform_window_delegate()->OnActivationChanged(false);
375 }
376 void OnRequestClose(mus::Window* window) override {
377 platform_window_delegate()->OnCloseRequest();
378 }
365 379
366 private: 380 private:
367 mus::Window* mus_window() { return native_widget_mus_->window(); } 381 mus::Window* mus_window() { return native_widget_mus_->window(); }
368 WindowTreeHostMus* window_tree_host() { 382 WindowTreeHostMus* window_tree_host() {
369 return native_widget_mus_->window_tree_host(); 383 return native_widget_mus_->window_tree_host();
370 } 384 }
371 ui::PlatformWindowDelegate* platform_window_delegate() { 385 ui::PlatformWindowDelegate* platform_window_delegate() {
372 return native_widget_mus_->window_tree_host(); 386 return native_widget_mus_->window_tree_host();
373 } 387 }
374 388
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 GetNativeWindow()->Show(); 1223 GetNativeWindow()->Show();
1210 } else { 1224 } else {
1211 window_tree_host_->Hide(); 1225 window_tree_host_->Hide();
1212 window_->SetVisible(false); 1226 window_->SetVisible(false);
1213 GetNativeWindow()->Hide(); 1227 GetNativeWindow()->Hide();
1214 } 1228 }
1215 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); 1229 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible());
1216 } 1230 }
1217 1231
1218 } // namespace views 1232 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/platform_window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698