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

Unified Diff: views/desktop/desktop_window_view.cc

Issue 7585028: NativeWidgetViews: Implement widget activation/deactivation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | views/widget/native_widget_views.h » ('j') | views/widget/widget_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/desktop/desktop_window_view.cc
diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc
index b2797973e6fcf42c7b32dc13658b387015e094ff..3668c25f4e0e5b2d6288f8cc9f4f6c1cf0dac7ca 100644
--- a/views/desktop/desktop_window_view.cc
+++ b/views/desktop/desktop_window_view.cc
@@ -138,15 +138,10 @@ void DesktopWindowView::ActivateWidget(Widget* widget) {
if (widget && widget->IsActive())
return;
- if (active_native_widget_)
- active_native_widget_->OnActivate(false);
if (widget) {
- widget->MoveToTop();
- active_native_widget_ =
- static_cast<NativeWidgetViews*>(widget->native_widget());
- active_native_widget_->OnActivate(true);
if (!widget->HasObserver(this))
widget->AddObserver(this);
+ widget->Activate();
}
}
@@ -252,6 +247,14 @@ void DesktopWindowView::OnWidgetVisibilityChanged(Widget* widget,
void DesktopWindowView::OnWidgetActivationChanged(Widget* widget,
bool active) {
+ if (active) {
+ if (active_native_widget_)
+ active_native_widget_->GetWidget()->Deactivate();
+ active_native_widget_ =
+ static_cast<NativeWidgetViews*>(widget->native_widget());
+ } else if (widget == active_native_widget_->GetWidget()) {
+ active_native_widget_ = NULL;
+ }
}
} // namespace desktop
« no previous file with comments | « no previous file | views/widget/native_widget_views.h » ('j') | views/widget/widget_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698