| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 if (!ShouldSaveOrRestoreWindowPos()) | 1619 if (!ShouldSaveOrRestoreWindowPos()) |
| 1620 return; | 1620 return; |
| 1621 | 1621 |
| 1622 if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) { | 1622 if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) { |
| 1623 WidgetDelegate::SaveWindowPlacement(bounds, show_state); | 1623 WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
| 1624 chrome::SaveWindowPlacement(browser_.get(), bounds, show_state); | 1624 chrome::SaveWindowPlacement(browser_.get(), bounds, show_state); |
| 1625 } | 1625 } |
| 1626 } | 1626 } |
| 1627 | 1627 |
| 1628 bool BrowserView::GetSavedWindowPlacement( | 1628 bool BrowserView::GetSavedWindowPlacement( |
| 1629 const views::Widget* widget, |
| 1629 gfx::Rect* bounds, | 1630 gfx::Rect* bounds, |
| 1630 ui::WindowShowState* show_state) const { | 1631 ui::WindowShowState* show_state) const { |
| 1631 if (!ShouldSaveOrRestoreWindowPos()) | 1632 if (!ShouldSaveOrRestoreWindowPos()) |
| 1632 return false; | 1633 return false; |
| 1633 chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state); | 1634 chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state); |
| 1634 | 1635 |
| 1635 if (browser_->is_type_popup() && | 1636 if (browser_->is_type_popup() && |
| 1636 !browser_->is_app() && | 1637 !browser_->is_app() && |
| 1637 !browser_->is_devtools()) { | 1638 !browser_->is_devtools()) { |
| 1638 // This is non-app popup window. The value passed in |bounds| represents | 1639 // This is non-app popup window. The value passed in |bounds| represents |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2706 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2707 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2707 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2708 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2708 LocationBarView::kIconInternalPadding + 1); | 2709 LocationBarView::kIconInternalPadding + 1); |
| 2709 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2710 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2710 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2711 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2711 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2712 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2712 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2713 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2713 } | 2714 } |
| 2714 return top_arrow_height; | 2715 return top_arrow_height; |
| 2715 } | 2716 } |
| OLD | NEW |