| 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_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #include "ui/views/layout/grid_layout.h" | 112 #include "ui/views/layout/grid_layout.h" |
| 113 #include "ui/views/widget/native_widget.h" | 113 #include "ui/views/widget/native_widget.h" |
| 114 #include "ui/views/widget/root_view.h" | 114 #include "ui/views/widget/root_view.h" |
| 115 #include "ui/views/widget/widget.h" | 115 #include "ui/views/widget/widget.h" |
| 116 #include "ui/views/window/dialog_delegate.h" | 116 #include "ui/views/window/dialog_delegate.h" |
| 117 | 117 |
| 118 #if defined(USE_ASH) | 118 #if defined(USE_ASH) |
| 119 #include "ash/launcher/launcher.h" | 119 #include "ash/launcher/launcher.h" |
| 120 #include "ash/launcher/launcher_model.h" | 120 #include "ash/launcher/launcher_model.h" |
| 121 #include "ash/shell.h" | 121 #include "ash/shell.h" |
| 122 #include "ash/wm/window_util.h" |
| 122 #include "chrome/browser/ui/ash/ash_util.h" | 123 #include "chrome/browser/ui/ash/ash_util.h" |
| 123 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 124 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 124 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" | 125 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
| 125 #include "chrome/browser/ui/ash/window_positioner.h" | 126 #include "chrome/browser/ui/ash/window_positioner.h" |
| 126 #elif defined(OS_WIN) && !defined(USE_AURA) | 127 #elif defined(OS_WIN) && !defined(USE_AURA) |
| 127 #include "base/win/metro.h" | 128 #include "base/win/metro.h" |
| 128 #include "chrome/browser/jumplist_win.h" | 129 #include "chrome/browser/jumplist_win.h" |
| 129 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 130 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
| 130 #include "ui/views/widget/native_widget_win.h" | 131 #include "ui/views/widget/native_widget_win.h" |
| 131 #include "ui/views/win/scoped_fullscreen_visibility.h" | 132 #include "ui/views/win/scoped_fullscreen_visibility.h" |
| (...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, | 1633 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, |
| 1633 ui::WindowShowState show_state) { | 1634 ui::WindowShowState show_state) { |
| 1634 // If IsFullscreen() is true, we've just changed into fullscreen mode, and | 1635 // If IsFullscreen() is true, we've just changed into fullscreen mode, and |
| 1635 // we're catching the going-into-fullscreen sizing and positioning calls, | 1636 // we're catching the going-into-fullscreen sizing and positioning calls, |
| 1636 // which we want to ignore. | 1637 // which we want to ignore. |
| 1637 if (!ShouldSaveOrRestoreWindowPos()) | 1638 if (!ShouldSaveOrRestoreWindowPos()) |
| 1638 return; | 1639 return; |
| 1639 | 1640 |
| 1640 if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) { | 1641 if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) { |
| 1641 WidgetDelegate::SaveWindowPlacement(bounds, show_state); | 1642 WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
| 1642 chrome::SaveWindowPlacement(browser_.get(), bounds, show_state); | 1643 bool user_has_changed_window_or_position = false; |
| 1644 #if defined(USE_ASH) |
| 1645 user_has_changed_window_or_position = |
| 1646 ash::wm::HasUserChangedWindowPositionOrSize( |
| 1647 browser_->window()->GetNativeWindow()); |
| 1648 #endif |
| 1649 chrome::SaveWindowPlacement(browser_.get(), |
| 1650 bounds, |
| 1651 show_state, |
| 1652 user_has_changed_window_or_position); |
| 1643 } | 1653 } |
| 1644 } | 1654 } |
| 1645 | 1655 |
| 1646 bool BrowserView::GetSavedWindowPlacement( | 1656 bool BrowserView::GetSavedWindowPlacement( |
| 1647 gfx::Rect* bounds, | 1657 gfx::Rect* bounds, |
| 1648 ui::WindowShowState* show_state) const { | 1658 ui::WindowShowState* show_state) const { |
| 1649 if (!ShouldSaveOrRestoreWindowPos()) | 1659 if (!ShouldSaveOrRestoreWindowPos()) |
| 1650 return false; | 1660 return false; |
| 1651 chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state); | 1661 chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state); |
| 1652 | 1662 |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 | 2696 |
| 2687 Browser* modal_browser = | 2697 Browser* modal_browser = |
| 2688 browser::FindBrowserWithWebContents(active_dialog->web_contents()); | 2698 browser::FindBrowserWithWebContents(active_dialog->web_contents()); |
| 2689 if (modal_browser && (browser_ != modal_browser)) { | 2699 if (modal_browser && (browser_ != modal_browser)) { |
| 2690 modal_browser->window()->FlashFrame(true); | 2700 modal_browser->window()->FlashFrame(true); |
| 2691 modal_browser->window()->Activate(); | 2701 modal_browser->window()->Activate(); |
| 2692 } | 2702 } |
| 2693 | 2703 |
| 2694 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2704 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
| 2695 } | 2705 } |
| OLD | NEW |