| OLD | NEW |
| 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 "chrome/browser/ui/views/frame/browser_frame_aura.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 10 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" | 10 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Allow the frame to be replaced when entering or exiting the maximized | 55 // Allow the frame to be replaced when entering or exiting the maximized |
| 56 // state. | 56 // state. |
| 57 if (browser_frame_->non_client_view() && | 57 if (browser_frame_->non_client_view() && |
| 58 browser_frame_aura_->browser_view()->browser()->is_app() && | 58 browser_frame_aura_->browser_view()->browser()->is_app() && |
| 59 (old_state == ui::SHOW_STATE_MAXIMIZED || | 59 (old_state == ui::SHOW_STATE_MAXIMIZED || |
| 60 new_state == ui::SHOW_STATE_MAXIMIZED)) { | 60 new_state == ui::SHOW_STATE_MAXIMIZED)) { |
| 61 // Defer frame layout when replacing the frame. Layout will occur when the | 61 // Defer frame layout when replacing the frame. Layout will occur when the |
| 62 // window's bounds are updated. The window maximize/restore animations | 62 // window's bounds are updated. The window maximize/restore animations |
| 63 // clone the window's layers and rely on the subsequent layout to set | 63 // clone the window's layers and rely on the subsequent layout to set |
| 64 // the layer sizes. | 64 // the layer sizes. |
| 65 browser_frame_->non_client_view()->UpdateFrame(false); | 65 // If the window is minimized, the frame view needs to be updated via |
| 66 // an OnBoundsChanged event so that the frame will change its size |
| 67 // properly. |
| 68 browser_frame_->non_client_view()->UpdateFrame( |
| 69 old_state == ui::SHOW_STATE_MINIMIZED); |
| 66 } | 70 } |
| 67 } | 71 } |
| 68 | 72 |
| 69 virtual void OnWindowBoundsChanged(aura::Window* window, | 73 virtual void OnWindowBoundsChanged(aura::Window* window, |
| 70 const gfx::Rect& old_bounds, | 74 const gfx::Rect& old_bounds, |
| 71 const gfx::Rect& new_bounds) OVERRIDE { | 75 const gfx::Rect& new_bounds) OVERRIDE { |
| 72 // Don't do anything if we don't have our non-client view yet. | 76 // Don't do anything if we don't have our non-client view yet. |
| 73 if (!browser_frame_->non_client_view()) | 77 if (!browser_frame_->non_client_view()) |
| 74 return; | 78 return; |
| 75 | 79 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return new DesktopBrowserFrameAura(browser_frame, browser_view); | 213 return new DesktopBrowserFrameAura(browser_frame, browser_view); |
| 210 #endif | 214 #endif |
| 211 return new BrowserFrameAura(browser_frame, browser_view); | 215 return new BrowserFrameAura(browser_frame, browser_view); |
| 212 } | 216 } |
| 213 | 217 |
| 214 /////////////////////////////////////////////////////////////////////////////// | 218 /////////////////////////////////////////////////////////////////////////////// |
| 215 // BrowserFrameAura, private: | 219 // BrowserFrameAura, private: |
| 216 | 220 |
| 217 BrowserFrameAura::~BrowserFrameAura() { | 221 BrowserFrameAura::~BrowserFrameAura() { |
| 218 } | 222 } |
| OLD | NEW |