Index: content/public/common/manifest_util.h |
diff --git a/content/public/common/manifest_util.h b/content/public/common/manifest_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f8f76cd0dd92ef442a76b7e0840351517e587045 |
--- /dev/null |
+++ b/content/public/common/manifest_util.h |
@@ -0,0 +1,42 @@ |
+// 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. |
+ |
+#ifndef CONTENT_PUBLIC_COMMON_MANIFEST_UTIL_H_ |
+#define CONTENT_PUBLIC_COMMON_MANIFEST_UTIL_H_ |
+ |
+#include <string> |
+ |
+#include "content/common/content_export.h" |
+#include "third_party/WebKit/public/platform/WebDisplayMode.h" |
+#include "third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h" |
+ |
+namespace content { |
+ |
+// Converts a blink::WebDisplayMode to a string. Returns one of |
+// https://www.w3.org/TR/appmanifest/#dfn-fallback-display-mode |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
You probably meant:
https://www.w3.org/TR/appmanif
|
+CONTENT_EXPORT std::string WebDisplayModeToString( |
+ blink::WebDisplayMode display); |
+ |
+// Returns the blink::WebDisplayMode which matches |display_string|. |
+// |display_string| should be one of |
+// https://www.w3.org/TR/appmanifest/#dfn-fallback-display-mode. Returns |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
ditto
|
+// blink::WebDisplayModeUndefined if there is no match. |
mlamouri (slow - plz ping)
2016/08/04 13:04:26
Add that |display_string| must be lower case?
|
+CONTENT_EXPORT blink::WebDisplayMode WebDisplayModeFromString( |
+ const std::string& display_string); |
mlamouri (slow - plz ping)
2016/08/04 13:04:26
nit: you use `display` in the implementation.
|
+ |
+// Converts a blink::WebScreenOrientationLockType to a string. Returns one of |
+// https://www.w3.org/TR/screen-orientation/#orientationlocktype-enum |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
Maybe note that WebScreenOrientationLockDefault wi
|
+CONTENT_EXPORT std::string WebScreenOrientationLockTypeToString( |
+ blink::WebScreenOrientationLockType); |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
style: add parameter name.
|
+ |
+// Returns the blink::WebScreenOrientationLockType which matches |
+// |orientation_string|. |orientation_string| should be one of |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
see below
|
+// https://www.w3.org/TR/screen-orientation/#orientationlocktype-enum. Returns |
+// blink::WebScreenOrientationLockDefault if there is no match. |
+CONTENT_EXPORT blink::WebScreenOrientationLockType |
+WebScreenOrientationLockTypeFromString(const std::string& orientation_string); |
mlamouri (slow - plz ping)
2016/08/04 13:04:27
s/orientation_string/orientation/ to match the imp
|
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_COMMON_MANIFEST_UTIL_H_ |