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. | |
331 if (IsFullscreen()) | 329 if (IsFullscreen()) |
332 return ui::SHOW_STATE_FULLSCREEN; | 330 return ui::SHOW_STATE_FULLSCREEN; |
333 | 331 #if defined(USE_ASH) |
334 // Use kRestoreShowStateKey in case a window is minimized/hidden. | 332 // Use kRestoreShowStateKey in case a window is minimized/hidden. |
335 ui::WindowShowState restore_state = | 333 ui::WindowShowState restore_state = |
336 window_->GetNativeWindow()->GetProperty( | 334 window_->GetNativeWindow()->GetProperty( |
337 aura::client::kRestoreShowStateKey); | 335 aura::client::kRestoreShowStateKey); |
338 // Whitelist states to return so that invalid and transient states | 336 // Whitelist states to return so that invalid and transient states |
339 // are not saved and used to restore windows when they are recreated. | 337 // are not saved and used to restore windows when they are recreated. |
340 switch (restore_state) { | 338 switch (restore_state) { |
341 case ui::SHOW_STATE_NORMAL: | 339 case ui::SHOW_STATE_NORMAL: |
342 case ui::SHOW_STATE_MAXIMIZED: | 340 case ui::SHOW_STATE_MAXIMIZED: |
343 case ui::SHOW_STATE_FULLSCREEN: | 341 case ui::SHOW_STATE_FULLSCREEN: |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 780 |
783 void NativeAppWindowViews::HandleKeyboardEvent( | 781 void NativeAppWindowViews::HandleKeyboardEvent( |
784 const content::NativeWebKeyboardEvent& event) { | 782 const content::NativeWebKeyboardEvent& event) { |
785 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 783 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
786 GetFocusManager()); | 784 GetFocusManager()); |
787 } | 785 } |
788 | 786 |
789 void NativeAppWindowViews::RenderViewHostChanged() { | 787 void NativeAppWindowViews::RenderViewHostChanged() { |
790 OnViewWasResized(); | 788 OnViewWasResized(); |
791 } | 789 } |
OLD | NEW |