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

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

Issue 11193053: Fix extraneous resizing of main WebContents when switching between tabs with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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) 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 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 } 2529 }
2530 UpdateUIForContents(new_contents); 2530 UpdateUIForContents(new_contents);
2531 2531
2532 #if defined(USE_AURA) 2532 #if defined(USE_AURA)
2533 // |change_tab_contents| can mean same WebContents but different TabContents, 2533 // |change_tab_contents| can mean same WebContents but different TabContents,
2534 // so let SearchViewController decide how it would handle |new_contents|. 2534 // so let SearchViewController decide how it would handle |new_contents|.
2535 if (search_view_controller_.get()) 2535 if (search_view_controller_.get())
2536 search_view_controller_->SetTabContents(new_contents); 2536 search_view_controller_->SetTabContents(new_contents);
2537 #endif 2537 #endif
2538 2538
2539 // Layout for DevTools _before_ setting the main WebContents to avoid
2540 // toggling the size of the main WebContents.
2541 UpdateDevToolsForContents(new_contents);
2542
2539 if (change_tab_contents) 2543 if (change_tab_contents)
2540 contents_container_->SetWebContents(new_contents->web_contents()); 2544 contents_container_->SetWebContents(new_contents->web_contents());
2541 2545
2542 UpdateDevToolsForContents(new_contents);
2543 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && 2546 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() &&
2544 GetWidget()->IsVisible()) { 2547 GetWidget()->IsVisible()) {
2545 // We only restore focus if our window is visible, to avoid invoking blur 2548 // We only restore focus if our window is visible, to avoid invoking blur
2546 // handlers when we are eventually shown. 2549 // handlers when we are eventually shown.
2547 new_contents->web_contents()->GetView()->RestoreFocus(); 2550 new_contents->web_contents()->GetView()->RestoreFocus();
2548 } 2551 }
2549 2552
2550 // Update all the UI bits. 2553 // Update all the UI bits.
2551 UpdateTitleBar(); 2554 UpdateTitleBar();
2552 2555
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 2689
2687 Browser* modal_browser = 2690 Browser* modal_browser =
2688 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2691 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2689 if (modal_browser && (browser_ != modal_browser)) { 2692 if (modal_browser && (browser_ != modal_browser)) {
2690 modal_browser->window()->FlashFrame(true); 2693 modal_browser->window()->FlashFrame(true);
2691 modal_browser->window()->Activate(); 2694 modal_browser->window()->Activate();
2692 } 2695 }
2693 2696
2694 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2697 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2695 } 2698 }
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