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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 // WebContents. | 825 // WebContents. |
826 | 826 |
827 // When we toggle the NTP floating bookmarks bar and/or the info bar, | 827 // When we toggle the NTP floating bookmarks bar and/or the info bar, |
828 // we don't want any WebContents to be attached, so that we | 828 // we don't want any WebContents to be attached, so that we |
829 // avoid an unnecessary resize and re-layout of a WebContents. | 829 // avoid an unnecessary resize and re-layout of a WebContents. |
830 if (change_tab_contents) { | 830 if (change_tab_contents) { |
831 contents_web_view_->SetWebContents(NULL); | 831 contents_web_view_->SetWebContents(NULL); |
832 devtools_web_view_->SetWebContents(NULL); | 832 devtools_web_view_->SetWebContents(NULL); |
833 } | 833 } |
834 | 834 |
835 InfoBarManager* infobar_manager = | 835 infobar_container_->ChangeInfoBarManager( |
836 InfoBarService::InfoBarManagerFromWebContents(new_contents); | 836 InfoBarService::FromWebContents(new_contents)); |
837 infobar_container_->ChangeInfoBarManager(infobar_manager); | |
838 | 837 |
839 if (old_contents && PermissionBubbleManager::FromWebContents(old_contents)) | 838 if (old_contents && PermissionBubbleManager::FromWebContents(old_contents)) |
840 PermissionBubbleManager::FromWebContents(old_contents)->SetView(NULL); | 839 PermissionBubbleManager::FromWebContents(old_contents)->SetView(NULL); |
841 | 840 |
842 if (new_contents && PermissionBubbleManager::FromWebContents(new_contents)) { | 841 if (new_contents && PermissionBubbleManager::FromWebContents(new_contents)) { |
843 PermissionBubbleManager::FromWebContents(new_contents)->SetView( | 842 PermissionBubbleManager::FromWebContents(new_contents)->SetView( |
844 permission_bubble_view_.get()); | 843 permission_bubble_view_.get()); |
845 } | 844 } |
846 | 845 |
847 if (bookmark_bar_view_.get()) { | 846 if (bookmark_bar_view_.get()) { |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2582 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2584 gfx::Point icon_bottom( | 2583 gfx::Point icon_bottom( |
2585 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2584 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2586 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2585 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2587 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2586 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2588 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2587 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2589 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2588 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2590 } | 2589 } |
2591 return top_arrow_height; | 2590 return top_arrow_height; |
2592 } | 2591 } |
OLD | NEW |