| Index: chrome/common/instant_types.h
|
| diff --git a/chrome/common/instant_types.h b/chrome/common/instant_types.h
|
| index 46638f92b879eed307eddf7950f174b7638b51ed..453cf17cf8bfc42b8384a80fd565c52608a29e26 100644
|
| --- a/chrome/common/instant_types.h
|
| +++ b/chrome/common/instant_types.h
|
| @@ -1,20 +1,82 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 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 CHROME_COMMON_INSTANT_TYPES_H_
|
| #define CHROME_COMMON_INSTANT_TYPES_H_
|
|
|
| -// Enum describing the ways instant suggest text can be completed.
|
| +#include <string>
|
| +
|
| +#include "googleurl/src/gurl.h"
|
| +
|
| +// Ways that the Instant suggested text is autocompleted into the omnibox.
|
| enum InstantCompleteBehavior {
|
| - // Complete the suggestion now.
|
| + // Autocomplete the suggestion immediately.
|
| INSTANT_COMPLETE_NOW,
|
|
|
| - // Complete the suggestion after a delay.
|
| + // Autocomplete the suggestion after a delay.
|
| INSTANT_COMPLETE_DELAYED,
|
|
|
| - // Never complete the suggestion.
|
| - INSTANT_COMPLETE_NEVER
|
| + // Do not autocomplete the suggestion. The suggestion may still be displayed
|
| + // in the omnibox, but not made a part of the omnibox text by default (e.g.,
|
| + // by displaying the suggestion as non-highlighted, non-selected gray text).
|
| + INSTANT_COMPLETE_NEVER,
|
| +
|
| + // Treat the suggested text as the entire omnibox text, effectively replacing
|
| + // whatever the user has typed.
|
| + INSTANT_COMPLETE_REPLACE,
|
| +};
|
| +
|
| +// The type of suggestion provided by Instant. For example, if Instant suggests
|
| +// "yahoo.com", should that be considered a search string or a URL?
|
| +enum InstantSuggestionType {
|
| + INSTANT_SUGGESTION_SEARCH,
|
| + INSTANT_SUGGESTION_URL,
|
| +};
|
| +
|
| +// A wrapper to hold Instant suggested text and its metadata such as the type
|
| +// of the suggestion and what completion behavior should be applied to it.
|
| +struct InstantSuggestion {
|
| + InstantSuggestion();
|
| + InstantSuggestion(const std::string& in_text,
|
| + InstantCompleteBehavior in_behavior,
|
| + InstantSuggestionType in_type);
|
| + ~InstantSuggestion();
|
| +
|
| + std::string text;
|
| + InstantCompleteBehavior behavior;
|
| + InstantSuggestionType type;
|
| +};
|
| +
|
| +// Omnibox dropdown matches provided by the native autocomplete providers.
|
| +struct InstantNativeSuggestionsParts {
|
| + InstantNativeSuggestionsParts();
|
| + ~InstantNativeSuggestionsParts();
|
| +
|
| + // The provider name. May be empty.
|
| + std::string provider;
|
| +
|
| + // True iff this is a search suggestion.
|
| + bool is_search;
|
| +
|
| + // The title of the match.
|
| + std::string contents;
|
| +
|
| + // The URL of the match.
|
| + // TODO(dhollowa): Remove this once the privacy story is sorted out.
|
| + GURL destination_url;
|
| +
|
| + // The relevance score of this match.
|
| + int relevance;
|
| +};
|
| +
|
| +// How to interpret the size (dimensions) of the Instant overlay (preview).
|
| +enum InstantSizeUnits {
|
| + // As an absolute number of pixels.
|
| + INSTANT_SIZE_PIXELS,
|
| +
|
| + // As a percentage of the size of the containing (parent) view.
|
| + INSTANT_SIZE_PERCENT,
|
| };
|
|
|
| #endif // CHROME_COMMON_INSTANT_TYPES_H_
|
|
|