Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: chrome/common/instant_types.h

Issue 10809063: Adding Javascript support for the Extended Searchbox API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing string conversion. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/instant_types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_COMMON_INSTANT_TYPES_H_ 5 #ifndef CHROME_COMMON_INSTANT_TYPES_H_
6 #define CHROME_COMMON_INSTANT_TYPES_H_ 6 #define CHROME_COMMON_INSTANT_TYPES_H_
7 7
8 #include "base/string16.h"
9 #include "googleurl/src/gurl.h"
10
8 // Ways that the Instant suggested text is autocompleted into the omnibox. 11 // Ways that the Instant suggested text is autocompleted into the omnibox.
9 enum InstantCompleteBehavior { 12 enum InstantCompleteBehavior {
10 // Autocomplete the suggestion immediately. 13 // Autocomplete the suggestion immediately.
11 INSTANT_COMPLETE_NOW, 14 INSTANT_COMPLETE_NOW,
12 15
13 // Autocomplete the suggestion after a delay. 16 // Autocomplete the suggestion after a delay.
14 INSTANT_COMPLETE_DELAYED, 17 INSTANT_COMPLETE_DELAYED,
15 18
16 // Do not autocomplete the suggestion. The suggestion may still be displayed 19 // Do not autocomplete the suggestion. The suggestion may still be displayed
17 // in the omnibox, but not made a part of the omnibox text by default (e.g., 20 // in the omnibox, but not made a part of the omnibox text by default (e.g.,
18 // by displaying the suggestion as non-highlighted, non-selected gray text). 21 // by displaying the suggestion as non-highlighted, non-selected gray text).
19 INSTANT_COMPLETE_NEVER, 22 INSTANT_COMPLETE_NEVER,
23
24 // Treat the suggested text as the entire omnibox text, effectively replacing
25 // whatever the user has typed.
26 INSTANT_COMPLETE_REPLACE,
27 };
28
29 // The type of suggestion provided by Instant. For example, if Instant suggests
30 // "yahoo.com", should that be considered a search string or a URL?
31 enum InstantSuggestionType {
32 INSTANT_SUGGESTION_SEARCH,
33 INSTANT_SUGGESTION_URL,
34 };
35
36 // A wrapper to hold Instant suggested text and its metadata such as the type
37 // of the suggestion and what completion behavior should be applied to it.
38 struct InstantSuggestion {
39 InstantSuggestion();
40 InstantSuggestion(const string16& text,
41 InstantCompleteBehavior behavior,
42 InstantSuggestionType type);
43 ~InstantSuggestion();
44 void Clear();
sky 2012/08/14 17:10:10 newline between 43/44 and add a description. That
Shishir 2012/08/14 17:30:19 Removed the clear method.
45
46 string16 text;
47 InstantCompleteBehavior behavior;
48 InstantSuggestionType type;
49 };
50
51 // Omnibox dropdown matches provided by the native autocomplete providers.
52 struct InstantAutocompleteResult {
53 InstantAutocompleteResult();
54 ~InstantAutocompleteResult();
55
56 // The provider name. May be empty.
57 string16 provider;
58
59 // True iff this is a search suggestion.
60 bool is_search;
61
62 // The title of the match.
63 string16 contents;
64
65 // The URL of the match.
66 // TODO(dhollowa): Remove this once the privacy story is sorted out.
67 GURL destination_url;
68
69 // The relevance score of this match. Same as the relevance score stored in
70 // AutocompleteMatch.
71 int relevance;
72 };
73
74 // How to interpret the size (height or width) of the Instant overlay (preview).
75 enum InstantSizeUnits {
76 // As an absolute number of pixels.
77 INSTANT_SIZE_PIXELS,
78
79 // As a percentage of the height or width of the containing (parent) view.
80 INSTANT_SIZE_PERCENT,
20 }; 81 };
21 82
22 #endif // CHROME_COMMON_INSTANT_TYPES_H_ 83 #endif // CHROME_COMMON_INSTANT_TYPES_H_
OLDNEW
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/instant_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698