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 <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 | 2636 |
2637 int BrowserView::GetMaxTopInfoBarArrowHeight() { | 2637 int BrowserView::GetMaxTopInfoBarArrowHeight() { |
2638 int top_arrow_height = 0; | 2638 int top_arrow_height = 0; |
2639 // Only show the arrows when not in fullscreen and when there's no omnibox | 2639 // Only show the arrows when not in fullscreen and when there's no omnibox |
2640 // popup. | 2640 // popup. |
2641 if (!IsFullscreen() && | 2641 if (!IsFullscreen() && |
2642 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2642 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2643 gfx::Point icon_bottom( | 2643 gfx::Point icon_bottom( |
2644 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2644 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2645 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2645 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2646 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2646 gfx::Point infobar_top; |
2647 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2647 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2648 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2648 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2649 } | 2649 } |
2650 return top_arrow_height; | 2650 return top_arrow_height; |
2651 } | 2651 } |
2652 | 2652 |
2653 /////////////////////////////////////////////////////////////////////////////// | 2653 /////////////////////////////////////////////////////////////////////////////// |
2654 // BrowserView, ExclusiveAccessContext implementation: | 2654 // BrowserView, ExclusiveAccessContext implementation: |
2655 Profile* BrowserView::GetProfile() { | 2655 Profile* BrowserView::GetProfile() { |
2656 return browser_->profile(); | 2656 return browser_->profile(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 } | 2711 } |
2712 | 2712 |
2713 extensions::ActiveTabPermissionGranter* | 2713 extensions::ActiveTabPermissionGranter* |
2714 BrowserView::GetActiveTabPermissionGranter() { | 2714 BrowserView::GetActiveTabPermissionGranter() { |
2715 content::WebContents* web_contents = GetActiveWebContents(); | 2715 content::WebContents* web_contents = GetActiveWebContents(); |
2716 if (!web_contents) | 2716 if (!web_contents) |
2717 return nullptr; | 2717 return nullptr; |
2718 return extensions::TabHelper::FromWebContents(web_contents) | 2718 return extensions::TabHelper::FromWebContents(web_contents) |
2719 ->active_tab_permission_granter(); | 2719 ->active_tab_permission_granter(); |
2720 } | 2720 } |
OLD | NEW |