Chromium Code Reviews| Index: ios/web/web_view_util.mm |
| diff --git a/ios/web/web_view_util.mm b/ios/web/web_view_util.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3020b1901dd2acfc7ff02cb0bc1285d397d6efe6 |
| --- /dev/null |
| +++ b/ios/web/web_view_util.mm |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2014 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 "ios/web/web_view_util.h" |
| + |
| +#include "base/ios/ios_util.h" |
| + |
| +namespace { |
| + |
| +// If true, UIWebView is always used. |
|
sdefresne
2014/12/11 15:25:12
nit: // If true, UIWebView is always used, even if
|
| +bool g_force_ui_web_view = false; |
| + |
| +} // namespace |
| + |
| +namespace web { |
| + |
| +bool IsWKWebViewEnabled() { |
| +#if defined(ENABLE_WKWEBVIEW) |
| + // Eventually this may be a dynamic flag, but for now it's purely a |
| + // compile-time option. |
| + return !g_force_ui_web_view && base::ios::IsRunningOnIOS8OrLater(); |
| +#else |
| + return false; |
| +#endif |
| +} |
| + |
| +void SetForceUIWebView(bool flag) { |
| + g_force_ui_web_view = flag; |
| +} |
| + |
| +bool GetForceUIWebView() { |
| + return g_force_ui_web_view; |
| +} |
| + |
| +} // namespace web |