| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "components/metrics/proto/omnibox_event.pb.h" | 16 #include "components/metrics/proto/omnibox_event.pb.h" |
| 17 #include "components/metrics/proto/omnibox_input_type.pb.h" | 17 #include "components/omnibox/browser/autocomplete_input.h" |
| 18 #include "components/omnibox/browser/autocomplete_match_type.h" | 18 #include "components/omnibox/browser/autocomplete_match_type.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 struct Feature; | 21 struct Feature; |
| 22 class TimeDelta; | 22 class TimeDelta; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace omnibox { | 25 namespace omnibox { |
| 26 | 26 |
| 27 extern const base::Feature kNewOmniboxAnswerTypes; | 27 extern const base::Feature kNewOmniboxAnswerTypes; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // Returns the relevance score that KeywordProvider should assign to keywords | 368 // Returns the relevance score that KeywordProvider should assign to keywords |
| 369 // with sufficiently-complete matches, i.e., the user has typed all of the | 369 // with sufficiently-complete matches, i.e., the user has typed all of the |
| 370 // important part of the keyword. Returns -1 if the experiment isn't active. | 370 // important part of the keyword. Returns -1 if the experiment isn't active. |
| 371 static int KeywordScoreForSufficientlyCompleteMatch(); | 371 static int KeywordScoreForSufficientlyCompleteMatch(); |
| 372 | 372 |
| 373 // --------------------------------------------------------- | 373 // --------------------------------------------------------- |
| 374 // For the EmphasizeTitles experiment that's part of the bundled omnibox | 374 // For the EmphasizeTitles experiment that's part of the bundled omnibox |
| 375 // field trial. | 375 // field trial. |
| 376 | 376 |
| 377 // Returns the conditions under which the UI code should display the title | 377 // Returns the conditions under which the UI code should display the title |
| 378 // of a URL more prominently than the URL for an input of type |input_type|. | 378 // of a URL more prominently than the URL for input |input|. Normally the URL |
| 379 // Normally the URL is displayed more prominently. Returns NEVER_EMPHASIZE | 379 // is displayed more prominently. Returns NEVER_EMPHASIZE if the experiment |
| 380 // if the experiment isn't active. | 380 // isn't active. |
| 381 static EmphasizeTitlesCondition GetEmphasizeTitlesConditionForInput( | 381 static EmphasizeTitlesCondition GetEmphasizeTitlesConditionForInput( |
| 382 metrics::OmniboxInputType::Type input_type); | 382 const AutocompleteInput& input); |
| 383 | 383 |
| 384 // --------------------------------------------------------- | 384 // --------------------------------------------------------- |
| 385 // For PhysicalWebProvider related experiments. | 385 // For PhysicalWebProvider related experiments. |
| 386 | 386 |
| 387 // Returns whether the user is in a Physical Web field trial where the | 387 // Returns whether the user is in a Physical Web field trial where the |
| 388 // PhysicalWebProvider should be used to get suggestions when the user clicks | 388 // PhysicalWebProvider should be used to get suggestions when the user clicks |
| 389 // on the omnibox but has not typed anything yet. | 389 // on the omnibox but has not typed anything yet. |
| 390 static bool InPhysicalWebZeroSuggestFieldTrial(); | 390 static bool InPhysicalWebZeroSuggestFieldTrial(); |
| 391 | 391 |
| 392 // Returns whether the user is in a Physical Web field trial and URL-based | 392 // Returns whether the user is in a Physical Web field trial and URL-based |
| 393 // suggestions can continue to appear after the user has started typing. | 393 // suggestions can continue to appear after the user has started typing. |
| 394 static bool InPhysicalWebAfterTypingFieldTrial(); | 394 static bool InPhysicalWebAfterTypingFieldTrial(); |
| 395 | 395 |
| 396 // Returns the base relevance score for Physical Web omnibox suggestions when | 396 // Returns the base relevance score for Physical Web omnibox suggestions when |
| 397 // the user has clicked on the omnibox but has not typed anything yet. | 397 // the user has clicked on the omnibox but has not typed anything yet. |
| 398 static int GetPhysicalWebZeroSuggestBaseRelevance(); | 398 static int GetPhysicalWebZeroSuggestBaseRelevance(); |
| 399 | 399 |
| 400 // Returns the base relevance score for Physical Web omnibox suggestions when | 400 // Returns the base relevance score for Physical Web omnibox suggestions when |
| 401 // the user has started typing in the omnibox. | 401 // the user has started typing in the omnibox. |
| 402 static int GetPhysicalWebAfterTypingBaseRelevance(); | 402 static int GetPhysicalWebAfterTypingBaseRelevance(); |
| 403 | 403 |
| 404 // --------------------------------------------------------- | 404 // --------------------------------------------------------- |
| 405 // For experiment redirecting zero suggest requests to a service provided by | 405 // For experiment redirecting zero suggest requests to a service provided by |
| 406 // the Chrome team. | 406 // the Chrome team. |
| 407 | 407 |
| 408 // Returns whether the user is in the field trial which redirects zero suggest | 408 // Returns true whether the user is in the field trial which redirects zero |
| 409 // requests to the service provided by the Chrome team. | 409 // suggest requests to the service provided by the Chrome team. |
| 410 static bool InZeroSuggestRedirectToChromeFieldTrial(); | 410 static bool InZeroSuggestRedirectToChromeFieldTrial(); |
| 411 | 411 |
| 412 // Returns a string representing the address of the server where the zero | 412 // Returns a string representing the address of the server where the zero |
| 413 // suggest requests are being redirected. The return value is a URL | 413 // suggest requests are being redirected. The return value is a URL |
| 414 // (https://example.com/test) and it doesn't include any query component | 414 // (https://example.com/test) and it doesn't include any query component |
| 415 // (no "?"). | 415 // (no "?"). |
| 416 static std::string ZeroSuggestRedirectToChromeServerAddress(); | 416 static std::string ZeroSuggestRedirectToChromeServerAddress(); |
| 417 | 417 |
| 418 // Returns a string representing the parameters that are sent to the | 418 // Returns a string representing the parameters that are sent to the |
| 419 // alternative service providing zero suggestions. The returned value is | 419 // alternative service providing zero suggestions. The returned value is |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 // prioritize different wildcard contexts, see the implementation. How to | 504 // prioritize different wildcard contexts, see the implementation. How to |
| 505 // interpret the value is left to the caller; this is rule-dependent. | 505 // interpret the value is left to the caller; this is rule-dependent. |
| 506 static std::string GetValueForRuleInContext( | 506 static std::string GetValueForRuleInContext( |
| 507 const std::string& rule, | 507 const std::string& rule, |
| 508 metrics::OmniboxEventProto::PageClassification page_classification); | 508 metrics::OmniboxEventProto::PageClassification page_classification); |
| 509 | 509 |
| 510 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 510 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 511 }; | 511 }; |
| 512 | 512 |
| 513 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ | 513 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |