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

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

Issue 2690553004: Fixes bug in DesktopWindowTreeHostMus's activation handling (Closed)
Patch Set: Created 3 years, 10 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/desktop_window_tree_host_mus_unittest.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 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 "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 ->GetDisplayNearestWindow(const_cast<aura::Window*>(window())) 524 ->GetDisplayNearestWindow(const_cast<aura::Window*>(window()))
525 .work_area(); 525 .work_area();
526 } 526 }
527 527
528 void DesktopWindowTreeHostMus::SetShape( 528 void DesktopWindowTreeHostMus::SetShape(
529 std::unique_ptr<SkRegion> native_region) { 529 std::unique_ptr<SkRegion> native_region) {
530 NOTIMPLEMENTED(); 530 NOTIMPLEMENTED();
531 } 531 }
532 532
533 void DesktopWindowTreeHostMus::Activate() { 533 void DesktopWindowTreeHostMus::Activate() {
534 if (!IsVisible())
535 return;
536
537 // This should result in OnActiveFocusClientChanged() being called, which
538 // triggers a call to DesktopNativeWidgetAura::HandleActivationChanged(),
539 // which focuses the right window.
534 aura::Env::GetInstance()->SetActiveFocusClient( 540 aura::Env::GetInstance()->SetActiveFocusClient(
535 aura::client::GetFocusClient(window()), window()); 541 aura::client::GetFocusClient(window()), window());
536 if (is_active_) { 542 if (is_active_)
537 window()->Focus(); 543 window()->SetProperty(aura::client::kDrawAttentionKey, false);
sky 2017/02/10 19:18:48 The explicit call to Focus() isn't necessary here
538 if (window()->GetProperty(aura::client::kDrawAttentionKey))
539 window()->SetProperty(aura::client::kDrawAttentionKey, false);
540 }
541 } 544 }
542 545
543 void DesktopWindowTreeHostMus::Deactivate() { 546 void DesktopWindowTreeHostMus::Deactivate() {
544 if (is_active_) 547 if (is_active_)
545 DeactivateWindow(); 548 DeactivateWindow();
546 } 549 }
547 550
548 bool DesktopWindowTreeHostMus::IsActive() const { 551 bool DesktopWindowTreeHostMus::IsActive() const {
549 return is_active_; 552 return is_active_;
550 } 553 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 aura::client::FocusClient* focus_client, 798 aura::client::FocusClient* focus_client,
796 aura::Window* window) { 799 aura::Window* window) {
797 if (window == this->window()) { 800 if (window == this->window()) {
798 desktop_native_widget_aura_->HandleActivationChanged(true); 801 desktop_native_widget_aura_->HandleActivationChanged(true);
799 } else if (is_active_) { 802 } else if (is_active_) {
800 desktop_native_widget_aura_->HandleActivationChanged(false); 803 desktop_native_widget_aura_->HandleActivationChanged(false);
801 } 804 }
802 } 805 }
803 806
804 } // namespace views 807 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698