| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL_H_ | 6 #define CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // Gets whether sending the URL of the base page is disabled. | 32 // Gets whether sending the URL of the base page is disabled. |
| 33 bool IsSendBasePageURLDisabled(); | 33 bool IsSendBasePageURLDisabled(); |
| 34 | 34 |
| 35 // Gets whether decoding the mentions fields in the Resolve is disabled. | 35 // Gets whether decoding the mentions fields in the Resolve is disabled. |
| 36 bool IsDecodeMentionsDisabled(); | 36 bool IsDecodeMentionsDisabled(); |
| 37 | 37 |
| 38 // Gets whether Bar integration with Contextual Cards data is enabled. | 38 // Gets whether Bar integration with Contextual Cards data is enabled. |
| 39 bool IsContextualCardsBarIntegrationEnabled(); | 39 bool IsContextualCardsBarIntegrationEnabled(); |
| 40 | 40 |
| 41 // Gets an explicit version to use for Contextual Cards integration, or 0 if |
| 42 // not set. |
| 43 int GetContextualCardsVersion(); |
| 44 |
| 41 // Disables the cache. | 45 // Disables the cache. |
| 42 void DisableCache(); | 46 void DisableCache(); |
| 43 | 47 |
| 44 // Constant used in tests. | 48 // Constant used in tests. |
| 45 static const int kContextualSearchDefaultIcingSurroundingSize; | 49 static const int kContextualSearchDefaultIcingSurroundingSize; |
| 46 | 50 |
| 47 protected: | 51 protected: |
| 48 // Checks if command-line switch of the given name exists. | 52 // Checks if command-line switch of the given name exists. |
| 49 virtual bool HasSwitch(const std::string& name); | 53 virtual bool HasSwitch(const std::string& name); |
| 50 | 54 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 67 // Caches the result pointed to by the given |cached_value|, using the given | 71 // Caches the result pointed to by the given |cached_value|, using the given |
| 68 // |is_value_cached| to remember if the value has been cached or not. | 72 // |is_value_cached| to remember if the value has been cached or not. |
| 69 int GetIntParamValueOrDefault(const std::string& param_name, | 73 int GetIntParamValueOrDefault(const std::string& param_name, |
| 70 const int default_value, | 74 const int default_value, |
| 71 bool* is_value_cached, | 75 bool* is_value_cached, |
| 72 int* cached_value); | 76 int* cached_value); |
| 73 | 77 |
| 74 // Cached values. | 78 // Cached values. |
| 75 bool is_resolver_url_prefix_cached_; | 79 bool is_resolver_url_prefix_cached_; |
| 76 std::string resolver_url_prefix_; | 80 std::string resolver_url_prefix_; |
| 81 |
| 77 bool is_surrounding_size_cached_; | 82 bool is_surrounding_size_cached_; |
| 78 int surrounding_size_; | 83 int surrounding_size_; |
| 84 |
| 79 bool is_icing_surrounding_size_cached_; | 85 bool is_icing_surrounding_size_cached_; |
| 80 int icing_surrounding_size_; | 86 int icing_surrounding_size_; |
| 87 |
| 81 bool is_send_base_page_url_disabled_cached_; | 88 bool is_send_base_page_url_disabled_cached_; |
| 82 bool is_send_base_page_url_disabled_; | 89 bool is_send_base_page_url_disabled_; |
| 90 |
| 83 bool is_decode_mentions_disabled_cached_; | 91 bool is_decode_mentions_disabled_cached_; |
| 84 bool is_decode_mentions_disabled_; | 92 bool is_decode_mentions_disabled_; |
| 93 |
| 85 bool is_contextual_cards_bar_integration_enabled_cached_; | 94 bool is_contextual_cards_bar_integration_enabled_cached_; |
| 86 bool is_contextual_cards_bar_integration_enabled_; | 95 bool is_contextual_cards_bar_integration_enabled_; |
| 87 | 96 |
| 97 bool is_contextual_cards_version_cached_; |
| 98 int contextual_cards_version_; |
| 99 |
| 88 DISALLOW_COPY_AND_ASSIGN(ContextualSearchFieldTrial); | 100 DISALLOW_COPY_AND_ASSIGN(ContextualSearchFieldTrial); |
| 89 }; | 101 }; |
| 90 | 102 |
| 91 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL
_H_ | 103 #endif // CHROME_BROWSER_ANDROID_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_FIELD_TRIAL
_H_ |
| OLD | NEW |