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

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

Issue 7781010: Avoid DevTools window growth on every window close-open cycle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 if (!IsFullscreen() && browser_->ShouldSaveWindowPlacement()) { 1644 if (!IsFullscreen() && browser_->ShouldSaveWindowPlacement()) {
1645 WidgetDelegate::SaveWindowPlacement(bounds, maximized); 1645 WidgetDelegate::SaveWindowPlacement(bounds, maximized);
1646 browser_->SaveWindowPlacement(bounds, 1646 browser_->SaveWindowPlacement(bounds,
1647 maximized ? ui::SHOW_STATE_MAXIMIZED : 1647 maximized ? ui::SHOW_STATE_MAXIMIZED :
1648 ui::SHOW_STATE_NORMAL); 1648 ui::SHOW_STATE_NORMAL);
1649 } 1649 }
1650 } 1650 }
1651 1651
1652 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { 1652 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const {
1653 *bounds = browser_->GetSavedWindowBounds(); 1653 *bounds = browser_->GetSavedWindowBounds();
1654 if (browser_->is_type_popup() || browser_->is_type_panel()) { 1654 if ((browser_->is_type_popup() || browser_->is_type_panel())
1655 && !browser_->is_devtools()) {
1655 // We are a popup window. The value passed in |bounds| represents two 1656 // We are a popup window. The value passed in |bounds| represents two
1656 // pieces of information: 1657 // pieces of information:
1657 // - the position of the window, in screen coordinates (outer position). 1658 // - the position of the window, in screen coordinates (outer position).
1658 // - the size of the content area (inner size). 1659 // - the size of the content area (inner size).
1659 // We need to use these values to determine the appropriate size and 1660 // We need to use these values to determine the appropriate size and
1660 // position of the resulting window. 1661 // position of the resulting window.
1661 if (IsToolbarVisible()) { 1662 if (IsToolbarVisible()) {
1662 // If we're showing the toolbar, we need to adjust |*bounds| to include 1663 // If we're showing the toolbar, we need to adjust |*bounds| to include
1663 // its desired height, since the toolbar is considered part of the 1664 // its desired height, since the toolbar is considered part of the
1664 // window's client area as far as GetWindowBoundsForClientBounds is 1665 // window's client area as far as GetWindowBoundsForClientBounds is
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2684 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2684 // Create the view and the frame. The frame will attach itself via the view 2685 // Create the view and the frame. The frame will attach itself via the view
2685 // so we don't need to do anything with the pointer. 2686 // so we don't need to do anything with the pointer.
2686 BrowserView* view = new BrowserView(browser); 2687 BrowserView* view = new BrowserView(browser);
2687 (new BrowserFrame(view))->InitBrowserFrame(); 2688 (new BrowserFrame(view))->InitBrowserFrame();
2688 view->GetWidget()->non_client_view()->SetAccessibleName( 2689 view->GetWidget()->non_client_view()->SetAccessibleName(
2689 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2690 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2690 return view; 2691 return view;
2691 } 2692 }
2692 #endif 2693 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698