| 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 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2585 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2584 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2586 gfx::Point icon_bottom( | 2585 gfx::Point icon_bottom( |
| 2587 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2586 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2588 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2587 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2589 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2588 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2590 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2589 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2591 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2590 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2592 } | 2591 } |
| 2593 return top_arrow_height; | 2592 return top_arrow_height; |
| 2594 } | 2593 } |
| OLD | NEW |