Chromium Code Reviews| 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 "ui/views/window/custom_frame_view.h" | 5 #include "ui/views/window/custom_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 | 274 |
| 275 int CustomFrameView::NonClientTopBorderHeight() const { | 275 int CustomFrameView::NonClientTopBorderHeight() const { |
| 276 return std::max(FrameBorderThickness() + IconSize(), | 276 return std::max(FrameBorderThickness() + IconSize(), |
| 277 CaptionButtonY() + kCaptionButtonHeightWithPadding) + | 277 CaptionButtonY() + kCaptionButtonHeightWithPadding) + |
| 278 TitlebarBottomThickness(); | 278 TitlebarBottomThickness(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 int CustomFrameView::CaptionButtonY() const { | 281 int CustomFrameView::CaptionButtonY() const { |
| 282 // Maximized buttons start at window top so that even if their images aren't | 282 // Maximized buttons start at window top so that even if their images aren't |
| 283 // drawn flush with the screen edge, they still obey Fitts' Law. | 283 // drawn flush with the screen edge, they still obey Fitts' Law. |
| 284 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
| 284 return frame_->IsMaximized() ? FrameBorderThickness() : kFrameBorderThickness; | 285 return frame_->IsMaximized() ? FrameBorderThickness() : kFrameBorderThickness; |
|
flackr
2014/06/13 12:46:33
This should just return FrameBorderThickness() as
jonross
2014/06/13 13:32:16
Done.
| |
| 286 #else | |
| 287 return frame_->IsMaximized() ? FrameBorderThickness() : kFrameShadowThickness; | |
| 288 #endif | |
| 285 } | 289 } |
| 286 | 290 |
| 287 int CustomFrameView::TitlebarBottomThickness() const { | 291 int CustomFrameView::TitlebarBottomThickness() const { |
| 288 return kTitlebarTopAndBottomEdgeThickness + | 292 return kTitlebarTopAndBottomEdgeThickness + |
| 289 (ShouldShowClientEdge() ? kClientEdgeThickness : 0); | 293 (ShouldShowClientEdge() ? kClientEdgeThickness : 0); |
| 290 } | 294 } |
| 291 | 295 |
| 292 int CustomFrameView::IconSize() const { | 296 int CustomFrameView::IconSize() const { |
| 293 #if defined(OS_WIN) | 297 #if defined(OS_WIN) |
| 294 // This metric scales up if either the titlebar height or the titlebar font | 298 // This metric scales up if either the titlebar height or the titlebar font |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 } | 617 } |
| 614 case views::FRAME_BUTTON_CLOSE: { | 618 case views::FRAME_BUTTON_CLOSE: { |
| 615 button = close_button_; | 619 button = close_button_; |
| 616 break; | 620 break; |
| 617 } | 621 } |
| 618 } | 622 } |
| 619 return button; | 623 return button; |
| 620 } | 624 } |
| 621 | 625 |
| 622 } // namespace views | 626 } // namespace views |
| OLD | NEW |