OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/apps/native_app_window_views.h" | 5 #include "chrome/browser/ui/views/apps/native_app_window_views.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return window_->GetNativeWindow(); | 319 return window_->GetNativeWindow(); |
320 } | 320 } |
321 | 321 |
322 gfx::Rect NativeAppWindowViews::GetRestoredBounds() const { | 322 gfx::Rect NativeAppWindowViews::GetRestoredBounds() const { |
323 return window_->GetRestoredBounds(); | 323 return window_->GetRestoredBounds(); |
324 } | 324 } |
325 | 325 |
326 ui::WindowShowState NativeAppWindowViews::GetRestoredState() const { | 326 ui::WindowShowState NativeAppWindowViews::GetRestoredState() const { |
327 if (IsMaximized()) | 327 if (IsMaximized()) |
328 return ui::SHOW_STATE_MAXIMIZED; | 328 return ui::SHOW_STATE_MAXIMIZED; |
| 329 #if defined(USE_ASH) |
| 330 // On Ash, restore fullscreen. |
329 if (IsFullscreen()) | 331 if (IsFullscreen()) |
330 return ui::SHOW_STATE_FULLSCREEN; | 332 return ui::SHOW_STATE_FULLSCREEN; |
331 #if defined(USE_ASH) | 333 |
332 // Use kRestoreShowStateKey in case a window is minimized/hidden. | 334 // Use kRestoreShowStateKey in case a window is minimized/hidden. |
333 ui::WindowShowState restore_state = | 335 ui::WindowShowState restore_state = |
334 window_->GetNativeWindow()->GetProperty( | 336 window_->GetNativeWindow()->GetProperty( |
335 aura::client::kRestoreShowStateKey); | 337 aura::client::kRestoreShowStateKey); |
336 // Whitelist states to return so that invalid and transient states | 338 // Whitelist states to return so that invalid and transient states |
337 // are not saved and used to restore windows when they are recreated. | 339 // are not saved and used to restore windows when they are recreated. |
338 switch (restore_state) { | 340 switch (restore_state) { |
339 case ui::SHOW_STATE_NORMAL: | 341 case ui::SHOW_STATE_NORMAL: |
340 case ui::SHOW_STATE_MAXIMIZED: | 342 case ui::SHOW_STATE_MAXIMIZED: |
341 case ui::SHOW_STATE_FULLSCREEN: | 343 case ui::SHOW_STATE_FULLSCREEN: |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 786 |
785 void NativeAppWindowViews::HandleKeyboardEvent( | 787 void NativeAppWindowViews::HandleKeyboardEvent( |
786 const content::NativeWebKeyboardEvent& event) { | 788 const content::NativeWebKeyboardEvent& event) { |
787 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 789 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
788 GetFocusManager()); | 790 GetFocusManager()); |
789 } | 791 } |
790 | 792 |
791 void NativeAppWindowViews::RenderViewHostChanged() { | 793 void NativeAppWindowViews::RenderViewHostChanged() { |
792 OnViewWasResized(); | 794 OnViewWasResized(); |
793 } | 795 } |
OLD | NEW |