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

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

Issue 1968133002: views/mus: Fix activating a widget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | 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/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/thread_task_runner_handle.h" 8 #include "base/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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 } 822 }
823 823
824 bool NativeWidgetMus::IsVisible() const { 824 bool NativeWidgetMus::IsVisible() const {
825 // TODO(beng): this should probably be wired thru PlatformWindow. 825 // TODO(beng): this should probably be wired thru PlatformWindow.
826 return window_ && window_->visible(); 826 return window_ && window_->visible();
827 } 827 }
828 828
829 void NativeWidgetMus::Activate() { 829 void NativeWidgetMus::Activate() {
830 if (window_) 830 if (window_)
831 window_->SetFocus(); 831 window_->SetFocus();
832 static_cast<aura::client::ActivationClient*>(focus_client_.get())
833 ->ActivateWindow(content_);
832 } 834 }
833 835
834 void NativeWidgetMus::Deactivate() { 836 void NativeWidgetMus::Deactivate() {
835 if (IsActive()) 837 if (IsActive())
836 window_->connection()->ClearFocus(); 838 window_->connection()->ClearFocus();
837 } 839 }
838 840
839 bool NativeWidgetMus::IsActive() const { 841 bool NativeWidgetMus::IsActive() const {
840 mus::Window* focused = 842 mus::Window* focused =
841 window_ ? window_->connection()->GetFocusedWindow() : nullptr; 843 window_ ? window_->connection()->GetFocusedWindow() : nullptr;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 GetNativeWindow()->Show(); 1156 GetNativeWindow()->Show();
1155 } else { 1157 } else {
1156 window_tree_host_->Hide(); 1158 window_tree_host_->Hide();
1157 window_->SetVisible(false); 1159 window_->SetVisible(false);
1158 GetNativeWindow()->Hide(); 1160 GetNativeWindow()->Hide();
1159 } 1161 }
1160 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); 1162 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible());
1161 } 1163 }
1162 1164
1163 } // namespace views 1165 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698