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

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

Issue 11428083: Stack preview back at top after an active contents switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 browser_->search_model()->mode()); 1646 browser_->search_model()->mode());
1647 } 1647 }
1648 UpdateUIForContents(new_contents); 1648 UpdateUIForContents(new_contents);
1649 1649
1650 // Layout for DevTools _before_ setting the main WebContents to avoid 1650 // Layout for DevTools _before_ setting the main WebContents to avoid
1651 // toggling the size of the main WebContents. 1651 // toggling the size of the main WebContents.
1652 UpdateDevToolsForContents(new_contents); 1652 UpdateDevToolsForContents(new_contents);
1653 1653
1654 if (change_tab_contents) { 1654 if (change_tab_contents) {
1655 contents_container_->SetWebContents(new_contents); 1655 contents_container_->SetWebContents(new_contents);
1656 #if defined(USE_AURA) 1656 contents_->MaybeStackPreviewAtTop();
1657 // Put the Instant preview back on top in case it is showing custom new tab
1658 // page content.
1659 if (contents_->preview_web_contents()) {
1660 ui::Layer* preview_layer =
1661 contents_->preview_web_contents()->GetNativeView()->layer();
1662 preview_layer->parent()->StackAtTop(preview_layer);
1663 }
1664 #endif
1665 } 1657 }
1666 1658
1667 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && 1659 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() &&
1668 GetWidget()->IsVisible()) { 1660 GetWidget()->IsVisible()) {
1669 // We only restore focus if our window is visible, to avoid invoking blur 1661 // We only restore focus if our window is visible, to avoid invoking blur
1670 // handlers when we are eventually shown. 1662 // handlers when we are eventually shown.
1671 new_contents->GetView()->RestoreFocus(); 1663 new_contents->GetView()->RestoreFocus();
1672 } 1664 }
1673 1665
1674 // Update all the UI bits. 1666 // Update all the UI bits.
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 modal_browser->window()->Activate(); 2772 modal_browser->window()->Activate();
2781 } 2773 }
2782 2774
2783 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2775 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2784 } 2776 }
2785 2777
2786 void BrowserView::MaybeStackBookmarkBarAtTop() { 2778 void BrowserView::MaybeStackBookmarkBarAtTop() {
2787 if (bookmark_bar_view_.get()) 2779 if (bookmark_bar_view_.get())
2788 bookmark_bar_view_->MaybeStackAtTop(); 2780 bookmark_bar_view_->MaybeStackAtTop();
2789 } 2781 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/contents_container.h » ('j') | chrome/browser/ui/views/frame/contents_container.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698