| 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_layout.h" | 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 using views::View; | 33 using views::View; |
| 34 using web_modal::WebContentsModalDialogHost; | 34 using web_modal::WebContentsModalDialogHost; |
| 35 using web_modal::ModalDialogHostObserver; | 35 using web_modal::ModalDialogHostObserver; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 // The visible height of the shadow above the tabs. Clicks in this area are | 39 // The visible height of the shadow above the tabs. Clicks in this area are |
| 40 // treated as clicks to the frame, rather than clicks to the tab. | 40 // treated as clicks to the frame, rather than clicks to the tab. |
| 41 const int kTabShadowSize = 2; | 41 const int kTabShadowSize = 2; |
| 42 // The number of pixels the bookmark bar should overlap the spacer by if the | |
| 43 // spacer is visible. | |
| 44 const int kSpacerBookmarkBarOverlap = 1; | |
| 45 // The number of pixels the metro switcher is offset from the right edge. | 42 // The number of pixels the metro switcher is offset from the right edge. |
| 46 const int kWindowSwitcherOffsetX = 7; | 43 const int kWindowSwitcherOffsetX = 7; |
| 47 // The number of pixels the constrained window should overlap the bottom | 44 // The number of pixels the constrained window should overlap the bottom |
| 48 // of the omnibox. | 45 // of the omnibox. |
| 49 const int kConstrainedWindowOverlap = 3; | 46 const int kConstrainedWindowOverlap = 3; |
| 50 | 47 |
| 51 // Combines View::ConvertPointToTarget and View::HitTest for a given |point|. | 48 // Combines View::ConvertPointToTarget and View::HitTest for a given |point|. |
| 52 // Converts |point| from |src| to |dst| and hit tests it against |dst|. The | 49 // Converts |point| from |src| to |dst| and hit tests it against |dst|. The |
| 53 // converted |point| can then be retrieved and used for additional tests. | 50 // converted |point| can then be retrieved and used for additional tests. |
| 54 bool ConvertedHitTest(views::View* src, views::View* dst, gfx::Point* point) { | 51 bool ConvertedHitTest(views::View* src, views::View* dst, gfx::Point* point) { |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 return bottom; | 573 return bottom; |
| 577 } | 574 } |
| 578 | 575 |
| 579 bool BrowserViewLayout::InfobarVisible() const { | 576 bool BrowserViewLayout::InfobarVisible() const { |
| 580 // Cast to a views::View to access GetPreferredSize(). | 577 // Cast to a views::View to access GetPreferredSize(). |
| 581 views::View* infobar_container = infobar_container_; | 578 views::View* infobar_container = infobar_container_; |
| 582 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 579 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
| 583 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 580 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
| 584 (infobar_container->GetPreferredSize().height() != 0); | 581 (infobar_container->GetPreferredSize().height() != 0); |
| 585 } | 582 } |
| OLD | NEW |