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

Side by Side Diff: ash/ash_layout_constants.cc

Issue 1505223004: Do not use assets for Ash window control button backgrounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for owners review Created 4 years, 11 months 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/ash_layout_constants.h"
6
7 #include "base/logging.h"
8 #include "ui/base/resource/material_design/material_design_controller.h"
9
10 gfx::Size GetAshLayoutSize(AshLayoutSize size) {
11 const int kBrowserMaximizedCaptionButtonHeight[] = {27, 32, 36};
12 const int kBrowserMaximizedCaptionButtonWidth[] = {35, 32, 32};
13 const int kBrowserRestoredCaptionButtonHeight[] = {35, 36, 40};
14 const int kBrowserRestoredCaptionButtonWidth[] = {35, 32, 32};
15 const int kNonBrowserCaptionButtonHeight[] = {33, 33, 33};
16 const int kNonBrowserCaptionButtonWidth[] = {32, 32, 32};
17
18 const int mode = ui::MaterialDesignController::GetMode();
19 switch (size) {
20 case BROWSER_MAXIMIZED_CAPTION_BUTTON: {
21 return gfx::Size(kBrowserMaximizedCaptionButtonWidth[mode],
22 kBrowserMaximizedCaptionButtonHeight[mode]);
23 }
24 case BROWSER_RESTORED_CAPTION_BUTTON: {
25 return gfx::Size(kBrowserRestoredCaptionButtonWidth[mode],
26 kBrowserRestoredCaptionButtonHeight[mode]);
27 }
28 case NON_BROWSER_CAPTION_BUTTON: {
29 return gfx::Size(kNonBrowserCaptionButtonWidth[mode],
30 kNonBrowserCaptionButtonHeight[mode]);
31 }
32 }
33
34 NOTREACHED();
35 return gfx::Size();
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698