| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/views/frame/browser_frame.h" | 7 #include "chrome/browser/views/frame/browser_frame.h" |
| 8 #include "chrome/browser/views/frame/browser_view.h" | 8 #include "chrome/browser/views/frame/browser_view.h" |
| 9 #include "chrome/browser/views/tabs/tab_strip.h" | 9 #include "chrome/browser/views/tabs/tab_strip.h" |
| 10 #include "chrome/common/gfx/chrome_canvas.h" | 10 #include "chrome/common/gfx/chrome_canvas.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const { | 568 bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const { |
| 569 // If the point is outside the bounds of the client area, claim it. | 569 // If the point is outside the bounds of the client area, claim it. |
| 570 bool in_nonclient = NonClientFrameView::HitTest(l); | 570 bool in_nonclient = NonClientFrameView::HitTest(l); |
| 571 if (in_nonclient) | 571 if (in_nonclient) |
| 572 return in_nonclient; | 572 return in_nonclient; |
| 573 | 573 |
| 574 // Otherwise claim it only if it's in a non-tab portion of the tabstrip. | 574 // Otherwise claim it only if it's in a non-tab portion of the tabstrip. |
| 575 if (l.y() > browser_view_->tabstrip()->bounds().bottom()) | 575 if (l.y() > browser_view_->tabstrip()->bounds().bottom()) |
| 576 return false; | 576 return false; |
| 577 | 577 |
| 578 // We convert from our parent's coordinates since we assume we fill its bounds |
| 579 // completely. We need to do this since we're not a parent of the tabstrip, |
| 580 // meaning ConvertPointToView would otherwise return something bogus. |
| 578 gfx::Point tabstrip_point(l); | 581 gfx::Point tabstrip_point(l); |
| 579 View::ConvertPointToView(this, browser_view_->tabstrip(), &tabstrip_point); | 582 View::ConvertPointToView(GetParent(), browser_view_->tabstrip(), |
| 583 &tabstrip_point); |
| 580 return browser_view_->tabstrip()->PointIsWithinWindowCaption(tabstrip_point); | 584 return browser_view_->tabstrip()->PointIsWithinWindowCaption(tabstrip_point); |
| 581 } | 585 } |
| 582 | 586 |
| 583 void OpaqueBrowserFrameView::ViewHierarchyChanged(bool is_add, | 587 void OpaqueBrowserFrameView::ViewHierarchyChanged(bool is_add, |
| 584 views::View* parent, | 588 views::View* parent, |
| 585 views::View* child) { | 589 views::View* child) { |
| 586 if (is_add && child == this) { | 590 if (is_add && child == this) { |
| 587 // The Accessibility glue looks for the product name on these two views to | 591 // The Accessibility glue looks for the product name on these two views to |
| 588 // determine if this is in fact a Chrome window. | 592 // determine if this is in fact a Chrome window. |
| 589 GetRootView()->SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); | 593 GetRootView()->SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 } | 1055 } |
| 1052 | 1056 |
| 1053 // static | 1057 // static |
| 1054 void OpaqueBrowserFrameView::InitAppWindowResources() { | 1058 void OpaqueBrowserFrameView::InitAppWindowResources() { |
| 1055 static bool initialized = false; | 1059 static bool initialized = false; |
| 1056 if (!initialized) { | 1060 if (!initialized) { |
| 1057 title_font_ = win_util::GetWindowTitleFont(); | 1061 title_font_ = win_util::GetWindowTitleFont(); |
| 1058 initialized = true; | 1062 initialized = true; |
| 1059 } | 1063 } |
| 1060 } | 1064 } |
| OLD | NEW |