| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/ui/views/app_window_frame_view.h" | 5 #include "apps/ui/views/app_window_frame_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "cc/paint/paint_flags.h" | 8 #include "cc/paint/paint_flags.h" |
| 9 #include "extensions/browser/app_window/native_app_window.h" | 9 #include "extensions/browser/app_window/native_app_window.h" |
| 10 #include "extensions/common/draggable_region.h" | 10 #include "extensions/common/draggable_region.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 views::CustomButton::STATE_NORMAL, | 298 views::CustomButton::STATE_NORMAL, |
| 299 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia()); | 299 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia()); |
| 300 } else { | 300 } else { |
| 301 close_button_->SetImage( | 301 close_button_->SetImage( |
| 302 views::CustomButton::STATE_NORMAL, | 302 views::CustomButton::STATE_NORMAL, |
| 303 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_U).ToImageSkia()); | 303 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_U).ToImageSkia()); |
| 304 } | 304 } |
| 305 | 305 |
| 306 SetButtonImagesForFrame(); | 306 SetButtonImagesForFrame(); |
| 307 // TODO(benwells): different look for inactive by default. | 307 // TODO(benwells): different look for inactive by default. |
| 308 cc::PaintFlags paint; | 308 cc::PaintFlags flags; |
| 309 paint.setAntiAlias(false); | 309 flags.setAntiAlias(false); |
| 310 paint.setStyle(cc::PaintFlags::kFill_Style); | 310 flags.setStyle(cc::PaintFlags::kFill_Style); |
| 311 paint.setColor(CurrentFrameColor()); | 311 flags.setColor(CurrentFrameColor()); |
| 312 gfx::Path path; | 312 gfx::Path path; |
| 313 path.moveTo(0, 0); | 313 path.moveTo(0, 0); |
| 314 path.lineTo(width(), 0); | 314 path.lineTo(width(), 0); |
| 315 path.lineTo(width(), kCaptionHeight); | 315 path.lineTo(width(), kCaptionHeight); |
| 316 path.lineTo(0, kCaptionHeight); | 316 path.lineTo(0, kCaptionHeight); |
| 317 path.close(); | 317 path.close(); |
| 318 canvas->DrawPath(path, paint); | 318 canvas->DrawPath(path, flags); |
| 319 } | 319 } |
| 320 | 320 |
| 321 const char* AppWindowFrameView::GetClassName() const { return kViewClassName; } | 321 const char* AppWindowFrameView::GetClassName() const { return kViewClassName; } |
| 322 | 322 |
| 323 gfx::Size AppWindowFrameView::GetMinimumSize() const { | 323 gfx::Size AppWindowFrameView::GetMinimumSize() const { |
| 324 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); | 324 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); |
| 325 if (!draw_frame_) { | 325 if (!draw_frame_) { |
| 326 min_size.SetToMax(gfx::Size(1, 1)); | 326 min_size.SetToMax(gfx::Size(1, 1)); |
| 327 return min_size; | 327 return min_size; |
| 328 } | 328 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 restore_button_->SetImage( | 395 restore_button_->SetImage( |
| 396 views::CustomButton::STATE_NORMAL, | 396 views::CustomButton::STATE_NORMAL, |
| 397 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia()); | 397 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia()); |
| 398 minimize_button_->SetImage( | 398 minimize_button_->SetImage( |
| 399 views::CustomButton::STATE_NORMAL, | 399 views::CustomButton::STATE_NORMAL, |
| 400 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia()); | 400 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia()); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace apps | 404 } // namespace apps |
| OLD | NEW |