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

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

Issue 10836218: Remove BrowserList::GetLastActive calls from window_sizer.cc et al. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 (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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 } 1630 }
1631 1631
1632 gfx::Rect window_rect = frame_->non_client_view()-> 1632 gfx::Rect window_rect = frame_->non_client_view()->
1633 GetWindowBoundsForClientBounds(*bounds); 1633 GetWindowBoundsForClientBounds(*bounds);
1634 window_rect.set_origin(bounds->origin()); 1634 window_rect.set_origin(bounds->origin());
1635 1635
1636 // When we are given x/y coordinates of 0 on a created popup window, 1636 // When we are given x/y coordinates of 0 on a created popup window,
1637 // assume none were given by the window.open() command. 1637 // assume none were given by the window.open() command.
1638 if (window_rect.x() == 0 && window_rect.y() == 0) { 1638 if (window_rect.x() == 0 && window_rect.y() == 0) {
1639 gfx::Size size = window_rect.size(); 1639 gfx::Size size = window_rect.size();
1640 window_rect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); 1640 window_rect.set_origin(
1641 WindowSizer::GetDefaultPopupOrigin(size,
1642 browser_->host_desktop_type()));
1641 } 1643 }
1642 1644
1643 *bounds = window_rect; 1645 *bounds = window_rect;
1644 *show_state = ui::SHOW_STATE_NORMAL; 1646 *show_state = ui::SHOW_STATE_NORMAL;
1645 } 1647 }
1646 1648
1647 // We return true because we can _always_ locate reasonable bounds using the 1649 // We return true because we can _always_ locate reasonable bounds using the
1648 // WindowSizer, and we don't want to trigger the Window's built-in "size to 1650 // WindowSizer, and we don't want to trigger the Window's built-in "size to
1649 // default" handling because the browser window has no default preferred 1651 // default" handling because the browser window has no default preferred
1650 // size. 1652 // size.
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 2605
2604 Browser* modal_browser = 2606 Browser* modal_browser =
2605 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2607 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2606 if (modal_browser && (browser_ != modal_browser)) { 2608 if (modal_browser && (browser_ != modal_browser)) {
2607 modal_browser->window()->FlashFrame(true); 2609 modal_browser->window()->FlashFrame(true);
2608 modal_browser->window()->Activate(); 2610 modal_browser->window()->Activate();
2609 } 2611 }
2610 2612
2611 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2613 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2612 } 2614 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/window_sizer/window_sizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698