Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: apps/ui/views/app_window_frame_view.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | cc/blimp/client_picture_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/browser/app_window/native_app_window.h" 8 #include "extensions/browser/app_window/native_app_window.h"
9 #include "extensions/common/draggable_region.h" 9 #include "extensions/common/draggable_region.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
11 #include "skia/ext/cdl_paint.h"
11 #include "third_party/skia/include/core/SkPaint.h" 12 #include "third_party/skia/include/core/SkPaint.h"
12 #include "third_party/skia/include/core/SkRegion.h" 13 #include "third_party/skia/include/core/SkRegion.h"
13 #include "ui/base/hit_test.h" 14 #include "ui/base/hit_test.h"
14 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
16 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
17 #include "ui/gfx/color_utils.h" 18 #include "ui/gfx/color_utils.h"
18 #include "ui/gfx/image/image.h" 19 #include "ui/gfx/image/image.h"
19 #include "ui/gfx/path.h" 20 #include "ui/gfx/path.h"
20 #include "ui/strings/grit/ui_strings.h" // Accessibility names 21 #include "ui/strings/grit/ui_strings.h" // Accessibility names
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 views::CustomButton::STATE_NORMAL, 299 views::CustomButton::STATE_NORMAL,
299 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia()); 300 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia());
300 } else { 301 } else {
301 close_button_->SetImage( 302 close_button_->SetImage(
302 views::CustomButton::STATE_NORMAL, 303 views::CustomButton::STATE_NORMAL,
303 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_U).ToImageSkia()); 304 rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_U).ToImageSkia());
304 } 305 }
305 306
306 SetButtonImagesForFrame(); 307 SetButtonImagesForFrame();
307 // TODO(benwells): different look for inactive by default. 308 // TODO(benwells): different look for inactive by default.
308 SkPaint paint; 309 CdlPaint paint;
309 paint.setAntiAlias(false); 310 paint.setAntiAlias(false);
310 paint.setStyle(SkPaint::kFill_Style); 311 paint.setStyle(CdlPaint::kFill_Style);
311 paint.setColor(CurrentFrameColor()); 312 paint.setColor(CurrentFrameColor());
312 gfx::Path path; 313 gfx::Path path;
313 path.moveTo(0, 0); 314 path.moveTo(0, 0);
314 path.lineTo(width(), 0); 315 path.lineTo(width(), 0);
315 path.lineTo(width(), kCaptionHeight); 316 path.lineTo(width(), kCaptionHeight);
316 path.lineTo(0, kCaptionHeight); 317 path.lineTo(0, kCaptionHeight);
317 path.close(); 318 path.close();
318 canvas->DrawPath(path, paint); 319 canvas->DrawPath(path, paint);
319 } 320 }
320 321
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 restore_button_->SetImage( 396 restore_button_->SetImage(
396 views::CustomButton::STATE_NORMAL, 397 views::CustomButton::STATE_NORMAL,
397 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia()); 398 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia());
398 minimize_button_->SetImage( 399 minimize_button_->SetImage(
399 views::CustomButton::STATE_NORMAL, 400 views::CustomButton::STATE_NORMAL,
400 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia()); 401 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia());
401 } 402 }
402 } 403 }
403 404
404 } // namespace apps 405 } // namespace apps
OLDNEW
« no previous file with comments | « DEPS ('k') | cc/blimp/client_picture_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698