| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file can be empty. Its purpose is to contain the relatively short lived | 5 // This file can be empty. Its purpose is to contain the relatively short lived |
| 6 // definitions required for experimental flags. | 6 // definitions required for experimental flags. |
| 7 | 7 |
| 8 #include "ios/chrome/browser/experimental_flags.h" | 8 #include "ios/chrome/browser/experimental_flags.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace experimental_flags { | 25 namespace experimental_flags { |
| 26 | 26 |
| 27 bool IsAlertOnBackgroundUploadEnabled() { | 27 bool IsAlertOnBackgroundUploadEnabled() { |
| 28 return [[NSUserDefaults standardUserDefaults] | 28 return [[NSUserDefaults standardUserDefaults] |
| 29 boolForKey:kEnableAlertOnBackgroundUpload]; | 29 boolForKey:kEnableAlertOnBackgroundUpload]; |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool IsOpenFromClipboardEnabled() { | 32 bool IsOpenFromClipboardEnabled() { |
| 33 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 33 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 34 return command_line->HasSwitch(switches::kEnableIOSOpenFromClipboard); | 34 if (command_line->HasSwitch(switches::kEnableIOSOpenFromClipboard)) |
| 35 return true; |
| 36 return base::FieldTrialList::FindFullName("IOSOpenFromClipboard") == |
| 37 "Enabled"; |
| 35 } | 38 } |
| 36 | 39 |
| 37 bool IsWKWebViewEnabled() { | 40 bool IsWKWebViewEnabled() { |
| 38 // If WKWebView isn't supported, don't activate the experiment at all. This | 41 // If WKWebView isn't supported, don't activate the experiment at all. This |
| 39 // avoids someone being slotted into the WKWebView bucket (and thus reporting | 42 // avoids someone being slotted into the WKWebView bucket (and thus reporting |
| 40 // as WKWebView), but actually running UIWebView. | 43 // as WKWebView), but actually running UIWebView. |
| 41 if (!web::IsWKWebViewSupported()) | 44 if (!web::IsWKWebViewSupported()) |
| 42 return false; | 45 return false; |
| 43 | 46 |
| 44 std::string group_name = | 47 std::string group_name = |
| (...skipping 26 matching lines...) Expand all Loading... |
| 71 } | 74 } |
| 72 | 75 |
| 73 // Parse the value. | 76 // Parse the value. |
| 74 size_t wedge_size_in_mb = 0; | 77 size_t wedge_size_in_mb = 0; |
| 75 if (base::StringToSizeT(wedge_size_string, &wedge_size_in_mb)) | 78 if (base::StringToSizeT(wedge_size_string, &wedge_size_in_mb)) |
| 76 return wedge_size_in_mb; | 79 return wedge_size_in_mb; |
| 77 return 0; | 80 return 0; |
| 78 } | 81 } |
| 79 | 82 |
| 80 } // namespace experimental_flags | 83 } // namespace experimental_flags |
| OLD | NEW |