| 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" | |
| 14 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 15 #include "url/url_parse.h" | 14 #include "url/url_parse.h" |
| 16 | 15 |
| 17 // The user input for an autocomplete query. Allows copying. | 16 // The user input for an autocomplete query. Allows copying. |
| 18 class AutocompleteInput { | 17 class AutocompleteInput { |
| 19 public: | 18 public: |
| 20 typedef metrics::OmniboxInputType::Type Type; | 19 // Note that the type below may be misleading. For example, "http:/" alone |
| 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 }; |
| 21 | 30 |
| 22 // The type of page currently displayed. | 31 // The type of page currently displayed. |
| 23 // Note: when adding an element to this enum, please add it at the end | 32 // Note: when adding an element to this enum, please add it at the end |
| 24 // and update omnibox_event.proto::PageClassification and | 33 // and update omnibox_event.proto::PageClassification and |
| 25 // omnibox_edit_model.cc::ClassifyPage() too. | 34 // omnibox_edit_model.cc::ClassifyPage() too. |
| 26 enum PageClassification { | 35 enum PageClassification { |
| 27 // An invalid URL; shouldn't happen. | 36 // An invalid URL; shouldn't happen. |
| 28 INVALID_SPEC = 0, | 37 INVALID_SPEC = 0, |
| 29 | 38 |
| 30 // chrome://newtab/. This can be either the built-in version or a | 39 // 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... |
| 231 url::Parsed parts_; | 240 url::Parsed parts_; |
| 232 base::string16 scheme_; | 241 base::string16 scheme_; |
| 233 GURL canonicalized_url_; | 242 GURL canonicalized_url_; |
| 234 bool prevent_inline_autocomplete_; | 243 bool prevent_inline_autocomplete_; |
| 235 bool prefer_keyword_; | 244 bool prefer_keyword_; |
| 236 bool allow_exact_keyword_match_; | 245 bool allow_exact_keyword_match_; |
| 237 bool want_asynchronous_matches_; | 246 bool want_asynchronous_matches_; |
| 238 }; | 247 }; |
| 239 | 248 |
| 240 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ | 249 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_INPUT_H_ |
| OLD | NEW |