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

Unified Diff: ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h

Issue 2588733002: Upstream Chrome on iOS source code [9/11]. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h b/ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1438804e4414c7570df677c919a59f66821d801
--- /dev/null
+++ b/ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h
@@ -0,0 +1,48 @@
+// Copyright 2013 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.
+
+#ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_RESOURCE_MACROS_H_
+#define IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_RESOURCE_MACROS_H_
+
+#include "ios/chrome/grit/ios_theme_resources.h"
+
+// These macros are used to populate the 3-dimensional array used to map from
+// a button's name/style/state combination to resource ID pointing to the image
+// to be used for the button.
+// Each macro should "produce" a 2x3 entry for a button specified by |name|
+// where style ∈ [light, dark] and state ∈ [normal, pressed, disabled].
+// 0 is used when the resource for a given combination does not exist.
+
+// clang-format off
+#define TOOLBAR_IDR_THREE_STATE(name) \
+ { { IDR_IOS_TOOLBAR_LIGHT_ ## name, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _PRESSED, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _DISABLED }, \
+ { IDR_IOS_TOOLBAR_DARK_ ## name, \
+ IDR_IOS_TOOLBAR_DARK_ ## name ## _PRESSED, \
+ IDR_IOS_TOOLBAR_DARK_ ## name ## _DISABLED } }
+
+#define TOOLBAR_IDR_TWO_STATE(name) \
+ { { IDR_IOS_TOOLBAR_LIGHT_ ## name, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _PRESSED, 0 }, \
+ { IDR_IOS_TOOLBAR_DARK_ ## name, \
+ IDR_IOS_TOOLBAR_DARK_ ## name ## _PRESSED, 0 } }
+
+#define TOOLBAR_IDR_ONE_STATE(name) \
+ { { IDR_IOS_TOOLBAR_LIGHT_ ## name, 0, 0 }, \
+ { IDR_IOS_TOOLBAR_LIGHT_ ## name, 0, 0 } }
+
+#define TOOLBAR_IDR_LIGHT_ONLY_THREE_STATE(name) \
+ { { IDR_IOS_TOOLBAR_LIGHT_ ## name, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _PRESSED, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _DISABLED }, \
+ { 0, 0, 0 } }
+
+#define TOOLBAR_IDR_LIGHT_ONLY_TWO_STATE(name) \
+ { { IDR_IOS_TOOLBAR_LIGHT_ ## name, \
+ IDR_IOS_TOOLBAR_LIGHT_ ## name ## _PRESSED, 0 }, \
+ { 0, 0, 0 } }
+// clang-format on
+
+#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_RESOURCE_MACROS_H_
« no previous file with comments | « ios/chrome/browser/ui/toolbar/toolbar_owner.h ('k') | ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698