| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_aura.h" | 5 #include "views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
| 9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 void NativeWidgetAura::CloseNow() { | 329 void NativeWidgetAura::CloseNow() { |
| 330 delete window_; | 330 delete window_; |
| 331 } | 331 } |
| 332 | 332 |
| 333 void NativeWidgetAura::EnableClose(bool enable) { | 333 void NativeWidgetAura::EnableClose(bool enable) { |
| 334 NOTIMPLEMENTED(); | 334 NOTIMPLEMENTED(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void NativeWidgetAura::Show() { | 337 void NativeWidgetAura::Show() { |
| 338 window_->Show(); | 338 ShowWithWindowState(ui::SHOW_STATE_INACTIVE); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void NativeWidgetAura::Hide() { | 341 void NativeWidgetAura::Hide() { |
| 342 window_->Hide(); | 342 window_->Hide(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void NativeWidgetAura::ShowMaximizedWithBounds( | 345 void NativeWidgetAura::ShowMaximizedWithBounds( |
| 346 const gfx::Rect& restored_bounds) { | 346 const gfx::Rect& restored_bounds) { |
| 347 window_->SetBounds(restored_bounds); | 347 window_->SetBounds(restored_bounds); |
| 348 window_->Maximize(); | 348 ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); |
| 349 window_->Show(); | |
| 350 } | 349 } |
| 351 | 350 |
| 352 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { | 351 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { |
| 353 switch(state) { | 352 switch (state) { |
| 354 case ui::SHOW_STATE_MAXIMIZED: | 353 case ui::SHOW_STATE_MAXIMIZED: |
| 355 window_->Maximize(); | 354 window_->Maximize(); |
| 356 break; | 355 break; |
| 357 case ui::SHOW_STATE_FULLSCREEN: | 356 case ui::SHOW_STATE_FULLSCREEN: |
| 358 window_->Fullscreen(); | 357 window_->Fullscreen(); |
| 359 break; | 358 break; |
| 360 default: | 359 default: |
| 361 break; | 360 break; |
| 362 } | 361 } |
| 363 window_->Show(); | 362 window_->Show(); |
| 363 if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE || |
| 364 !GetWidget()->SetInitialFocus())) |
| 365 window_->Activate(); |
| 364 } | 366 } |
| 365 | 367 |
| 366 bool NativeWidgetAura::IsVisible() const { | 368 bool NativeWidgetAura::IsVisible() const { |
| 367 return window_->IsVisible(); | 369 return window_->IsVisible(); |
| 368 } | 370 } |
| 369 | 371 |
| 370 void NativeWidgetAura::Activate() { | 372 void NativeWidgetAura::Activate() { |
| 371 window_->Activate(); | 373 window_->Activate(); |
| 372 } | 374 } |
| 373 | 375 |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 673 } |
| 672 | 674 |
| 673 // static | 675 // static |
| 674 bool NativeWidgetPrivate::IsMouseButtonDown() { | 676 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 675 NOTIMPLEMENTED(); | 677 NOTIMPLEMENTED(); |
| 676 return false; | 678 return false; |
| 677 } | 679 } |
| 678 | 680 |
| 679 } // namespace internal | 681 } // namespace internal |
| 680 } // namespace views | 682 } // namespace views |
| OLD | NEW |