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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 2652043004: Remove persisted docked windows (Closed)
Patch Set: varkha's comments 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 | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 void NativeWidgetAura::ShowMaximizedWithBounds( 527 void NativeWidgetAura::ShowMaximizedWithBounds(
528 const gfx::Rect& restored_bounds) { 528 const gfx::Rect& restored_bounds) {
529 SetRestoreBounds(window_, restored_bounds); 529 SetRestoreBounds(window_, restored_bounds);
530 ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); 530 ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED);
531 } 531 }
532 532
533 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { 533 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
534 if (!window_) 534 if (!window_)
535 return; 535 return;
536 536
537 // TODO(afakhry): Remove Docked Windows in M58.
537 if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN || 538 if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN ||
538 state == ui::SHOW_STATE_DOCKED) { 539 state == ui::SHOW_STATE_DOCKED) {
539 window_->SetProperty(aura::client::kShowStateKey, state); 540 window_->SetProperty(aura::client::kShowStateKey, state);
540 } 541 }
541 window_->Show(); 542 window_->Show();
542 if (delegate_->CanActivate()) { 543 if (delegate_->CanActivate()) {
543 if (state != ui::SHOW_STATE_INACTIVE) 544 if (state != ui::SHOW_STATE_INACTIVE)
544 Activate(); 545 Activate();
545 // SetInitialFocus() should be always be called, even for 546 // SetInitialFocus() should be always be called, even for
546 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will 547 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 destroying_ = true; 986 destroying_ = true;
986 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) 987 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
987 delete delegate_; 988 delete delegate_;
988 else 989 else
989 CloseNow(); 990 CloseNow();
990 } 991 }
991 992
992 //////////////////////////////////////////////////////////////////////////////// 993 ////////////////////////////////////////////////////////////////////////////////
993 // NativeWidgetAura, private: 994 // NativeWidgetAura, private:
994 995
996 // TODO(afakhry): Remove Docked Windows in M58.
995 bool NativeWidgetAura::IsDocked() const { 997 bool NativeWidgetAura::IsDocked() const {
996 return window_ && 998 return window_ &&
997 window_->GetProperty(aura::client::kShowStateKey) == 999 window_->GetProperty(aura::client::kShowStateKey) ==
998 ui::SHOW_STATE_DOCKED; 1000 ui::SHOW_STATE_DOCKED;
999 } 1001 }
1000 1002
1001 void NativeWidgetAura::SetInitialFocus(ui::WindowShowState show_state) { 1003 void NativeWidgetAura::SetInitialFocus(ui::WindowShowState show_state) {
1002 // The window does not get keyboard messages unless we focus it. 1004 // The window does not get keyboard messages unless we focus it.
1003 if (!GetWidget()->SetInitialFocus(show_state)) 1005 if (!GetWidget()->SetInitialFocus(show_state))
1004 window_->Focus(); 1006 window_->Focus();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 gfx::NativeView native_view) { 1205 gfx::NativeView native_view) {
1204 aura::client::CaptureClient* capture_client = 1206 aura::client::CaptureClient* capture_client =
1205 aura::client::GetCaptureClient(native_view->GetRootWindow()); 1207 aura::client::GetCaptureClient(native_view->GetRootWindow());
1206 if (!capture_client) 1208 if (!capture_client)
1207 return nullptr; 1209 return nullptr;
1208 return capture_client->GetGlobalCaptureWindow(); 1210 return capture_client->GetGlobalCaptureWindow();
1209 } 1211 }
1210 1212
1211 } // namespace internal 1213 } // namespace internal
1212 } // namespace views 1214 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698