| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_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/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
| 10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 aura::Env::GetInstance()->SetActiveFocusClient( | 446 aura::Env::GetInstance()->SetActiveFocusClient( |
| 447 aura::client::GetFocusClient(window()), window()); | 447 aura::client::GetFocusClient(window()), window()); |
| 448 if (is_active_) { | 448 if (is_active_) { |
| 449 window()->Focus(); | 449 window()->Focus(); |
| 450 if (window()->GetProperty(aura::client::kDrawAttentionKey)) | 450 if (window()->GetProperty(aura::client::kDrawAttentionKey)) |
| 451 window()->SetProperty(aura::client::kDrawAttentionKey, false); | 451 window()->SetProperty(aura::client::kDrawAttentionKey, false); |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 | 454 |
| 455 void DesktopWindowTreeHostMus::Deactivate() { | 455 void DesktopWindowTreeHostMus::Deactivate() { |
| 456 // TODO: Deactivate() means focus next window, that needs to go to mus. | 456 if (is_active_) |
| 457 // http://crbug.com/663618. | 457 ClearFocus(); |
| 458 NOTIMPLEMENTED(); | |
| 459 } | 458 } |
| 460 | 459 |
| 461 bool DesktopWindowTreeHostMus::IsActive() const { | 460 bool DesktopWindowTreeHostMus::IsActive() const { |
| 462 return is_active_; | 461 return is_active_; |
| 463 } | 462 } |
| 464 | 463 |
| 465 void DesktopWindowTreeHostMus::Maximize() { | 464 void DesktopWindowTreeHostMus::Maximize() { |
| 466 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 465 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 467 } | 466 } |
| 468 void DesktopWindowTreeHostMus::Minimize() { | 467 void DesktopWindowTreeHostMus::Minimize() { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 if (window == this->window()) { | 669 if (window == this->window()) { |
| 671 is_active_ = true; | 670 is_active_ = true; |
| 672 desktop_native_widget_aura_->HandleActivationChanged(true); | 671 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 673 } else if (is_active_) { | 672 } else if (is_active_) { |
| 674 is_active_ = false; | 673 is_active_ = false; |
| 675 desktop_native_widget_aura_->HandleActivationChanged(false); | 674 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 676 } | 675 } |
| 677 } | 676 } |
| 678 | 677 |
| 679 } // namespace views | 678 } // namespace views |
| OLD | NEW |