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

Unified Diff: ui/views/mus/platform_window_mus.cc

Issue 1967543002: Move ShowState-related code from PlatformWindowMus to NativeWidgetMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor show_state checks 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/platform_window_mus.cc
diff --git a/ui/views/mus/platform_window_mus.cc b/ui/views/mus/platform_window_mus.cc
index 9f05d2df198894735f8dbe6e83d1152d45e6178c..acf5ed1e1e909cc398f91588ec2fcbc22b9f24b9 100644
--- a/ui/views/mus/platform_window_mus.cc
+++ b/ui/views/mus/platform_window_mus.cc
@@ -68,7 +68,6 @@ PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
mus::Window* mus_window)
: delegate_(delegate),
mus_window_(mus_window),
- show_state_(mus::mojom::ShowState::DEFAULT),
last_cursor_(mus::mojom::Cursor::CURSOR_NULL),
mus_window_destroyed_(false) {
DCHECK(delegate_);
@@ -146,17 +145,11 @@ void PlatformWindowMus::ToggleFullscreen() {
NOTIMPLEMENTED();
}
-void PlatformWindowMus::Maximize() {
- SetShowState(mus::mojom::ShowState::MAXIMIZED);
-}
+void PlatformWindowMus::Maximize() {}
-void PlatformWindowMus::Minimize() {
- SetShowState(mus::mojom::ShowState::MINIMIZED);
-}
+void PlatformWindowMus::Minimize() {}
-void PlatformWindowMus::Restore() {
- SetShowState(mus::mojom::ShowState::NORMAL);
-}
+void PlatformWindowMus::Restore() {}
void PlatformWindowMus::SetCursor(ui::PlatformCursor cursor) {
NOTIMPLEMENTED();
@@ -174,12 +167,6 @@ ui::PlatformImeController* PlatformWindowMus::GetPlatformImeController() {
return nullptr;
}
-void PlatformWindowMus::SetShowState(mus::mojom::ShowState show_state) {
- mus_window_->SetSharedProperty<int32_t>(
- mus::mojom::WindowManager::kShowState_Property,
- static_cast<int32_t>(show_state));
-}
-
void PlatformWindowMus::OnWindowDestroyed(mus::Window* window) {
DCHECK_EQ(mus_window_, window);
mus_window_destroyed_ = true;
@@ -209,41 +196,6 @@ void PlatformWindowMus::OnWindowPredefinedCursorChanged(
last_cursor_ = cursor;
}
-void PlatformWindowMus::OnWindowSharedPropertyChanged(
- mus::Window* window,
- const std::string& name,
- const std::vector<uint8_t>* old_data,
- const std::vector<uint8_t>* new_data) {
- if (name != mus::mojom::WindowManager::kShowState_Property)
- return;
- mus::mojom::ShowState show_state =
- static_cast<mus::mojom::ShowState>(window->GetSharedProperty<int32_t>(
- mus::mojom::WindowManager::kShowState_Property));
- if (show_state == show_state_)
- return;
- show_state_ = show_state;
- ui::PlatformWindowState state = ui::PLATFORM_WINDOW_STATE_UNKNOWN;
- switch (show_state_) {
- case mus::mojom::ShowState::MINIMIZED:
- state = ui::PLATFORM_WINDOW_STATE_MINIMIZED;
- break;
- case mus::mojom::ShowState::MAXIMIZED:
- state = ui::PLATFORM_WINDOW_STATE_MAXIMIZED;
- break;
- case mus::mojom::ShowState::DEFAULT:
- case mus::mojom::ShowState::INACTIVE:
- case mus::mojom::ShowState::NORMAL:
- case mus::mojom::ShowState::DOCKED:
- // TODO(sky): support docked.
- state = ui::PLATFORM_WINDOW_STATE_NORMAL;
- break;
- case mus::mojom::ShowState::FULLSCREEN:
- state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN;
- break;
- }
- delegate_->OnWindowStateChanged(state);
-}
-
void PlatformWindowMus::OnRequestClose(mus::Window* window) {
delegate_->OnCloseRequest();
}
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698