| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 9 #include "ash/frame/default_header_painter.h" | 9 #include "ash/frame/default_header_painter.h" |
| 10 #include "ash/frame/frame_border_hit_test_controller.h" | 10 #include "ash/frame/frame_border_hit_test_controller.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 header_painter_->SetHeaderHeightForPainting(painted_height); | 288 header_painter_->SetHeaderHeightForPainting(painted_height); |
| 289 if (avatar_button()) | 289 if (avatar_button()) |
| 290 LayoutAvatar(); | 290 LayoutAvatar(); |
| 291 BrowserNonClientFrameView::Layout(); | 291 BrowserNonClientFrameView::Layout(); |
| 292 } | 292 } |
| 293 | 293 |
| 294 const char* BrowserNonClientFrameViewAsh::GetClassName() const { | 294 const char* BrowserNonClientFrameViewAsh::GetClassName() const { |
| 295 return kViewClassName; | 295 return kViewClassName; |
| 296 } | 296 } |
| 297 | 297 |
| 298 bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const { | 298 bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::RectF& rect) const { |
| 299 if (!views::View::HitTestRect(rect)) { | 299 if (!views::View::HitTestRect(rect)) { |
| 300 // |rect| is outside BrowserNonClientFrameViewAsh's bounds. | 300 // |rect| is outside BrowserNonClientFrameViewAsh's bounds. |
| 301 return false; | 301 return false; |
| 302 } | 302 } |
| 303 | 303 |
| 304 TabStrip* tabstrip = browser_view()->tabstrip(); | 304 TabStrip* tabstrip = browser_view()->tabstrip(); |
| 305 if (tabstrip && browser_view()->IsTabStripVisible()) { | 305 if (tabstrip && browser_view()->IsTabStripVisible()) { |
| 306 // Claim |rect| only if it is above the bottom of the tabstrip in a non-tab | 306 // Claim |rect| only if it is above the bottom of the tabstrip in a non-tab |
| 307 // portion. | 307 // portion. |
| 308 gfx::RectF rect_in_tabstrip_coords_f(rect); | 308 gfx::RectF rect_in_tabstrip_coords(rect); |
| 309 View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f); | 309 View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords); |
| 310 gfx::Rect rect_in_tabstrip_coords = gfx::ToEnclosingRect( | |
| 311 rect_in_tabstrip_coords_f); | |
| 312 | |
| 313 if (rect_in_tabstrip_coords.y() > tabstrip->height()) | 310 if (rect_in_tabstrip_coords.y() > tabstrip->height()) |
| 314 return false; | 311 return false; |
| 315 | 312 |
| 316 return !tabstrip->HitTestRect(rect_in_tabstrip_coords) || | 313 return !tabstrip->HitTestRect(rect_in_tabstrip_coords) || |
| 317 tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); | 314 tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); |
| 318 } | 315 } |
| 319 | 316 |
| 320 // Claim |rect| if it is above the top of the topmost view in the client area. | 317 // Claim |rect| if it is above the top of the topmost view in the client area. |
| 321 return rect.y() < GetTopInset(); | 318 return rect.y() < GetTopInset(); |
| 322 } | 319 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 530 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
| 534 } | 531 } |
| 535 | 532 |
| 536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 533 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
| 537 DCHECK(!UsePackagedAppHeaderStyle()); | 534 DCHECK(!UsePackagedAppHeaderStyle()); |
| 538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 535 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
| 539 width(), kClientEdgeThickness), | 536 width(), kClientEdgeThickness), |
| 540 ThemeProperties::GetDefaultColor( | 537 ThemeProperties::GetDefaultColor( |
| 541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 538 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
| 542 } | 539 } |
| OLD | NEW |