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

Unified 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 landing 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_layout_constants.h ('k') | ash/frame/caption_buttons/frame_caption_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ash_layout_constants.cc
diff --git a/ash/ash_layout_constants.cc b/ash/ash_layout_constants.cc
new file mode 100644
index 0000000000000000000000000000000000000000..de59f2c2b3e65932ef78ff6d91f3c5a5fa07e484
--- /dev/null
+++ b/ash/ash_layout_constants.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/ash_layout_constants.h"
+
+#include "base/logging.h"
+#include "ui/base/resource/material_design/material_design_controller.h"
+
+gfx::Size GetAshLayoutSize(AshLayoutSize size) {
+ const int kBrowserMaximizedCaptionButtonHeight[] = {27, 32, 36};
+ const int kBrowserMaximizedCaptionButtonWidth[] = {35, 32, 32};
+ const int kBrowserRestoredCaptionButtonHeight[] = {35, 36, 40};
+ const int kBrowserRestoredCaptionButtonWidth[] = {35, 32, 32};
+ const int kNonBrowserCaptionButtonHeight[] = {33, 33, 33};
+ const int kNonBrowserCaptionButtonWidth[] = {32, 32, 32};
+
+ const int mode = ui::MaterialDesignController::GetMode();
+ switch (size) {
+ case AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON: {
+ return gfx::Size(kBrowserMaximizedCaptionButtonWidth[mode],
+ kBrowserMaximizedCaptionButtonHeight[mode]);
+ }
+ case AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON: {
+ return gfx::Size(kBrowserRestoredCaptionButtonWidth[mode],
+ kBrowserRestoredCaptionButtonHeight[mode]);
+ }
+ case AshLayoutSize::NON_BROWSER_CAPTION_BUTTON: {
+ return gfx::Size(kNonBrowserCaptionButtonWidth[mode],
+ kNonBrowserCaptionButtonHeight[mode]);
+ }
+ }
+
+ NOTREACHED();
+ return gfx::Size();
+}
« no previous file with comments | « ash/ash_layout_constants.h ('k') | ash/frame/caption_buttons/frame_caption_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698