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

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: ash layout constants file added Created 5 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 side-by-side diff with in-line comments
Download patch
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..bb154fa2a4d1ea4a8758bdbc0b996c3699cb21c6
--- /dev/null
+++ b/ash/ash_layout_constants.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 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 kBrowserMaximizedHeaderButtonHeight[] = {27, 32, 36};
+ const int kBrowserMaximizedHeaderButtonWidth[] = {35, 32, 32};
+ const int kBrowserRestoredHeaderButtonHeight[] = {35, 36, 40};
+ const int kBrowserRestoredHeaderButtonWidth[] = {35, 32, 32};
+ const int kDefaultHeaderButtonHeight[] = {33, 33, 33};
+ const int kDefaultHeaderButtonWidth[] = {32, 32, 32};
+
+ const int mode = ui::MaterialDesignController::GetMode();
+ switch (size) {
+ case BROWSER_MAXIMIZED_HEADER_BUTTON: {
+ return gfx::Size(kBrowserMaximizedHeaderButtonWidth[mode],
+ kBrowserMaximizedHeaderButtonHeight[mode]);
+ }
+ case BROWSER_RESTORED_HEADER_BUTTON: {
+ return gfx::Size(kBrowserRestoredHeaderButtonWidth[mode],
+ kBrowserRestoredHeaderButtonHeight[mode]);
+ }
+ case DEFAULT_HEADER_BUTTON: {
+ return gfx::Size(kDefaultHeaderButtonWidth[mode],
+ kDefaultHeaderButtonHeight[mode]);
+ }
+ }
+
+ NOTREACHED();
+ return gfx::Size();
+}

Powered by Google App Engine
This is Rietveld 408576698