Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 511393003: No longer register app window placement preference keys on the fly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 // Translate WM_APPCOMMAND command ids into a command id that the browser 1588 // Translate WM_APPCOMMAND command ids into a command id that the browser
1589 // knows how to handle. 1589 // knows how to handle.
1590 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id); 1590 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id);
1591 if (command_id_from_app_command != -1) 1591 if (command_id_from_app_command != -1)
1592 command_id = command_id_from_app_command; 1592 command_id = command_id_from_app_command;
1593 1593
1594 return chrome::ExecuteCommand(browser_.get(), command_id); 1594 return chrome::ExecuteCommand(browser_.get(), command_id);
1595 } 1595 }
1596 1596
1597 std::string BrowserView::GetWindowName() const { 1597 std::string BrowserView::GetWindowName() const {
1598 return chrome::GetWindowPlacementKey(browser_.get()); 1598 return chrome::GetWindowName(browser_.get());
1599 } 1599 }
1600 1600
1601 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, 1601 void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds,
1602 ui::WindowShowState show_state) { 1602 ui::WindowShowState show_state) {
1603 // If IsFullscreen() is true, we've just changed into fullscreen mode, and 1603 // If IsFullscreen() is true, we've just changed into fullscreen mode, and
1604 // we're catching the going-into-fullscreen sizing and positioning calls, 1604 // we're catching the going-into-fullscreen sizing and positioning calls,
1605 // which we want to ignore. 1605 // which we want to ignore.
1606 if (!IsFullscreen() && frame_->ShouldSaveWindowPlacement() && 1606 if (!IsFullscreen() && frame_->ShouldSaveWindowPlacement() &&
1607 chrome::ShouldSaveWindowPlacement(browser_.get())) { 1607 chrome::ShouldSaveWindowPlacement(browser_.get())) {
1608 WidgetDelegate::SaveWindowPlacement(bounds, show_state); 1608 WidgetDelegate::SaveWindowPlacement(bounds, show_state);
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2513 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2514 gfx::Point icon_bottom( 2514 gfx::Point icon_bottom(
2515 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2515 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2516 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2516 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2517 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2517 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2518 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2518 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2519 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2519 top_arrow_height = infobar_top.y() - icon_bottom.y();
2520 } 2520 }
2521 return top_arrow_height; 2521 return top_arrow_height;
2522 } 2522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698