OLD | NEW |
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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 // callback to us and trigger layout. | 859 // callback to us and trigger layout. |
860 if (bookmark_bar_view_.get()) { | 860 if (bookmark_bar_view_.get()) { |
861 bookmark_bar_view_->SetBookmarkBarState( | 861 bookmark_bar_view_->SetBookmarkBarState( |
862 browser_->bookmark_bar_state(), | 862 browser_->bookmark_bar_state(), |
863 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); | 863 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); |
864 } | 864 } |
865 | 865 |
866 infobar_container_->ChangeInfoBarManager( | 866 infobar_container_->ChangeInfoBarManager( |
867 InfoBarService::FromWebContents(new_contents)); | 867 InfoBarService::FromWebContents(new_contents)); |
868 | 868 |
869 if (old_contents && PermissionBubbleManager::FromWebContents(old_contents)) | |
870 PermissionBubbleManager::FromWebContents(old_contents)->SetView(nullptr); | |
871 | |
872 if (new_contents && PermissionBubbleManager::FromWebContents(new_contents)) { | |
873 if (!permission_bubble_.get()) | |
874 permission_bubble_.reset(new PermissionBubbleViewViews(browser_.get())); | |
875 | |
876 PermissionBubbleManager::FromWebContents(new_contents)->SetView( | |
877 permission_bubble_.get()); | |
878 } | |
879 | |
880 UpdateUIForContents(new_contents); | 869 UpdateUIForContents(new_contents); |
881 | 870 |
882 // Layout for DevTools _before_ setting the both main and devtools WebContents | 871 // Layout for DevTools _before_ setting the both main and devtools WebContents |
883 // to avoid toggling the size of any of them. | 872 // to avoid toggling the size of any of them. |
884 UpdateDevToolsForContents(new_contents, !change_tab_contents); | 873 UpdateDevToolsForContents(new_contents, !change_tab_contents); |
885 | 874 |
886 if (change_tab_contents) { | 875 if (change_tab_contents) { |
887 web_contents_close_handler_->ActiveTabChanged(); | 876 web_contents_close_handler_->ActiveTabChanged(); |
888 contents_web_view_->SetWebContents(new_contents); | 877 contents_web_view_->SetWebContents(new_contents); |
889 // The second layout update should be no-op. It will just set the | 878 // The second layout update should be no-op. It will just set the |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 return immersive_mode_controller()->IsEnabled(); | 2597 return immersive_mode_controller()->IsEnabled(); |
2609 } | 2598 } |
2610 | 2599 |
2611 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2600 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2612 return GetWidget(); | 2601 return GetWidget(); |
2613 } | 2602 } |
2614 | 2603 |
2615 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2604 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2616 return top_container_->GetBoundsInScreen(); | 2605 return top_container_->GetBoundsInScreen(); |
2617 } | 2606 } |
OLD | NEW |