| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 int y = unavailable_px_at_top + (NonClientTopBorderHeight() - | 326 int y = unavailable_px_at_top + (NonClientTopBorderHeight() - |
| 327 unavailable_px_at_top - size - TitlebarBottomThickness() + 1) / 2; | 327 unavailable_px_at_top - size - TitlebarBottomThickness() + 1) / 2; |
| 328 return gfx::Rect(frame_thickness + kIconLeftSpacing + minimum_title_bar_x_, | 328 return gfx::Rect(frame_thickness + kIconLeftSpacing + minimum_title_bar_x_, |
| 329 y, size, size); | 329 y, size, size); |
| 330 } | 330 } |
| 331 | 331 |
| 332 bool CustomFrameView::ShouldShowTitleBarAndBorder() const { | 332 bool CustomFrameView::ShouldShowTitleBarAndBorder() const { |
| 333 if (frame_->IsFullscreen()) | 333 if (frame_->IsFullscreen()) |
| 334 return false; | 334 return false; |
| 335 | 335 |
| 336 if (ViewsDelegate::views_delegate) { | 336 if (ViewsDelegate::GetInstance()) { |
| 337 return !ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( | 337 return !ViewsDelegate::GetInstance()->WindowManagerProvidesTitleBar( |
| 338 frame_->IsMaximized()); | 338 frame_->IsMaximized()); |
| 339 } | 339 } |
| 340 | 340 |
| 341 return true; | 341 return true; |
| 342 } | 342 } |
| 343 | 343 |
| 344 bool CustomFrameView::ShouldShowClientEdge() const { | 344 bool CustomFrameView::ShouldShowClientEdge() const { |
| 345 return !frame_->IsMaximized() && ShouldShowTitleBarAndBorder(); | 345 return !frame_->IsMaximized() && ShouldShowTitleBarAndBorder(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { | 348 void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 case views::FRAME_BUTTON_CLOSE: { | 624 case views::FRAME_BUTTON_CLOSE: { |
| 625 button = close_button_; | 625 button = close_button_; |
| 626 break; | 626 break; |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 return button; | 629 return button; |
| 630 } | 630 } |
| 631 | 631 |
| 632 } // namespace views | 632 } // namespace views |
| OLD | NEW |