OLD | NEW |
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_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "components/metrics/proto/omnibox_input_type.pb.h" |
13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
14 #include "url/url_parse.h" | 15 #include "url/url_parse.h" |
15 | 16 |
16 // The user input for an autocomplete query. Allows copying. | 17 // The user input for an autocomplete query. Allows copying. |
17 class AutocompleteInput { | 18 class AutocompleteInput { |
18 public: | 19 public: |
19 // Note that the type below may be misleading. For example, "http:/" alone | 20 typedef metrics::OmniboxInputType::Type Type; |
20 // cannot be opened as a URL, so it is marked as a QUERY; yet the user | |
21 // probably intends to type more and have it eventually become a URL, so we | |
22 // need to make sure we still run it through inline autocomplete. | |
23 enum Type { | |
24 INVALID, // Empty input | |
25 UNKNOWN, // Valid input whose type cannot be determined | |
26 URL, // Input autodetected as a URL | |
27 QUERY, // Input autodetected as a query | |
28 FORCED_QUERY, // Input forced to be a query by an initial '?' | |
29 }; | |
30 | 21 |
31 // The type of page currently displayed. | 22 // The type of page currently displayed. |
32 // Note: when adding an element to this enum, please add it at the end | 23 // Note: when adding an element to this enum, please add it at the end |
33 // and update omnibox_event.proto::PageClassification and | 24 // and update omnibox_event.proto::PageClassification and |
34 // omnibox_edit_model.cc::ClassifyPage() too. | 25 // omnibox_edit_model.cc::ClassifyPage() too. |
35 enum PageClassification { | 26 enum PageClassification { |
36 // An invalid URL; shouldn't happen. | 27 // An invalid URL; shouldn't happen. |
37 INVALID_SPEC = 0, | 28 INVALID_SPEC = 0, |
38 | 29 |
39 // chrome://newtab/. This can be either the built-in version or a | 30 // chrome://newtab/. This can be either the built-in version or a |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 url::Parsed parts_; | 231 url::Parsed parts_; |
241 base::string16 scheme_; | 232 base::string16 scheme_; |
242 GURL canonicalized_url_; | 233 GURL canonicalized_url_; |
243 bool prevent_inline_autocomplete_; | 234 bool prevent_inline_autocomplete_; |
244 bool prefer_keyword_; | 235 bool prefer_keyword_; |
245 bool allow_exact_keyword_match_; | 236 bool allow_exact_keyword_match_; |
246 bool want_asynchronous_matches_; | 237 bool want_asynchronous_matches_; |
247 }; | 238 }; |
248 | 239 |
249 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ | 240 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ |
OLD | NEW |