| 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/ash/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
| 8 #include "ash/wm/workspace/frame_maximize_button.h" | 8 #include "ash/wm/workspace/frame_maximize_button.h" |
| 9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 const gfx::Rect& client_bounds) const { | 227 const gfx::Rect& client_bounds) const { |
| 228 int top_height = NonClientTopBorderHeight(false); | 228 int top_height = NonClientTopBorderHeight(false); |
| 229 return frame_painter_->GetWindowBoundsForClientBounds(top_height, | 229 return frame_painter_->GetWindowBoundsForClientBounds(top_height, |
| 230 client_bounds); | 230 client_bounds); |
| 231 } | 231 } |
| 232 | 232 |
| 233 int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) { | 233 int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) { |
| 234 int hit_test = frame_painter_->NonClientHitTest(this, point); | 234 int hit_test = frame_painter_->NonClientHitTest(this, point); |
| 235 // When the window is restored we want a large click target above the tabs | 235 // When the window is restored we want a large click target above the tabs |
| 236 // to drag the window, so redirect clicks in the tab's shadow to caption. | 236 // to drag the window, so redirect clicks in the tab's shadow to caption. |
| 237 if (hit_test == HTCLIENT && !frame()->IsMaximized()) { | 237 if (hit_test == HTCLIENT) { // && !frame()->IsMaximized()) { |
| 238 // Convert point to client coordinates. | 238 // Convert point to client coordinates. |
| 239 gfx::Point client_point(point); | 239 gfx::Point client_point(point); |
| 240 View::ConvertPointToTarget(this, frame()->client_view(), &client_point); | 240 View::ConvertPointToTarget(this, frame()->client_view(), &client_point); |
| 241 // Report hits in shadow at top of tabstrip as caption. | 241 // Report hits in shadow at top of tabstrip as caption. |
| 242 gfx::Rect tabstrip_bounds(browser_view()->tabstrip()->bounds()); | 242 gfx::Rect tabstrip_bounds(browser_view()->tabstrip()->bounds()); |
| 243 if (client_point.y() < tabstrip_bounds.y() + tab_shadow_height()) | 243 if (client_point.y() < tabstrip_bounds.y() + tab_shadow_height()) |
| 244 hit_test = HTCAPTION; | 244 hit_test = HTCAPTION; |
| 245 } | 245 } |
| 246 return hit_test; | 246 return hit_test; |
| 247 } | 247 } |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { | 604 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { |
| 605 ui::ThemeProvider* tp = GetThemeProvider(); | 605 ui::ThemeProvider* tp = GetThemeProvider(); |
| 606 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 606 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
| 607 browser_view()->IsBrowserTypeNormal() && | 607 browser_view()->IsBrowserTypeNormal() && |
| 608 !browser_view()->IsOffTheRecord()) { | 608 !browser_view()->IsOffTheRecord()) { |
| 609 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? | 609 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? |
| 610 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); | 610 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); |
| 611 } | 611 } |
| 612 return NULL; | 612 return NULL; |
| 613 } | 613 } |
| OLD | NEW |