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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 // Translate WM_APPCOMMAND command ids into a command id that the browser | 1591 // Translate WM_APPCOMMAND command ids into a command id that the browser |
1592 // knows how to handle. | 1592 // knows how to handle. |
1593 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id); | 1593 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id); |
1594 if (command_id_from_app_command != -1) | 1594 if (command_id_from_app_command != -1) |
1595 command_id = command_id_from_app_command; | 1595 command_id = command_id_from_app_command; |
1596 | 1596 |
1597 return chrome::ExecuteCommand(browser_.get(), command_id); | 1597 return chrome::ExecuteCommand(browser_.get(), command_id); |
1598 } | 1598 } |
1599 | 1599 |
1600 std::string BrowserView::GetWindowName() const { | 1600 std::string BrowserView::GetWindowName() const { |
1601 return chrome::GetWindowPlacementKey(browser_.get()); | 1601 return chrome::GetWindowName(browser_.get()); |
1602 } | 1602 } |
1603 | 1603 |
1604 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, | 1604 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, |
1605 ui::WindowShowState show_state) { | 1605 ui::WindowShowState show_state) { |
1606 // If IsFullscreen() is true, we've just changed into fullscreen mode, and | 1606 // If IsFullscreen() is true, we've just changed into fullscreen mode, and |
1607 // we're catching the going-into-fullscreen sizing and positioning calls, | 1607 // we're catching the going-into-fullscreen sizing and positioning calls, |
1608 // which we want to ignore. | 1608 // which we want to ignore. |
1609 if (!IsFullscreen() && frame_->ShouldSaveWindowPlacement() && | 1609 if (!IsFullscreen() && frame_->ShouldSaveWindowPlacement() && |
1610 chrome::ShouldSaveWindowPlacement(browser_.get())) { | 1610 chrome::ShouldSaveWindowPlacement(browser_.get())) { |
1611 WidgetDelegate::SaveWindowPlacement(bounds, show_state); | 1611 WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2545 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2546 gfx::Point icon_bottom( | 2546 gfx::Point icon_bottom( |
2547 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2547 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2548 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2548 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2549 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2549 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2550 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2550 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2551 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2551 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2552 } | 2552 } |
2553 return top_arrow_height; | 2553 return top_arrow_height; |
2554 } | 2554 } |
OLD | NEW |