OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 13 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
14 #include "chrome/browser/autocomplete/autocomplete_input.h" | 14 #include "chrome/browser/autocomplete/autocomplete_input.h" |
15 #include "chrome/browser/autocomplete/autocomplete_match.h" | 15 #include "chrome/browser/autocomplete/autocomplete_match.h" |
16 #include "chrome/browser/ui/omnibox/omnibox_controller.h" | 16 #include "chrome/browser/ui/omnibox/omnibox_controller.h" |
17 #include "chrome/common/instant_types.h" | 17 #include "chrome/common/instant_types.h" |
18 #include "chrome/common/omnibox_focus_state.h" | 18 #include "chrome/common/omnibox_focus_state.h" |
| 19 #include "components/metrics/proto/omnibox_event.pb.h" |
19 #include "content/public/common/page_transition_types.h" | 20 #include "content/public/common/page_transition_types.h" |
20 #include "ui/base/window_open_disposition.h" | 21 #include "ui/base/window_open_disposition.h" |
21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 class AutocompleteController; | 25 class AutocompleteController; |
25 class AutocompleteResult; | 26 class AutocompleteResult; |
26 class OmniboxCurrentPageDelegate; | 27 class OmniboxCurrentPageDelegate; |
27 class OmniboxEditController; | 28 class OmniboxEditController; |
28 class OmniboxPopupModel; | 29 class OmniboxPopupModel; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 size_t caret_position) const; | 414 size_t caret_position) const; |
414 | 415 |
415 // Checks if a given character is a valid space character for accepting | 416 // Checks if a given character is a valid space character for accepting |
416 // keyword. | 417 // keyword. |
417 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); | 418 static bool IsSpaceCharForAcceptingKeyword(wchar_t c); |
418 | 419 |
419 // Classify the current page being viewed as, for example, the new tab | 420 // Classify the current page being viewed as, for example, the new tab |
420 // page or a normal web page. Used for logging omnibox events for | 421 // page or a normal web page. Used for logging omnibox events for |
421 // UMA opted-in users. Examines the user's profile to determine if the | 422 // UMA opted-in users. Examines the user's profile to determine if the |
422 // current page is the user's home page. | 423 // current page is the user's home page. |
423 AutocompleteInput::PageClassification ClassifyPage() const; | 424 metrics::OmniboxEventProto::PageClassification ClassifyPage() const; |
424 | 425 |
425 // Sets |match| and |alternate_nav_url| based on classifying |text|. | 426 // Sets |match| and |alternate_nav_url| based on classifying |text|. |
426 // |alternate_nav_url| may be NULL. | 427 // |alternate_nav_url| may be NULL. |
427 void ClassifyStringForPasteAndGo(const base::string16& text, | 428 void ClassifyStringForPasteAndGo(const base::string16& text, |
428 AutocompleteMatch* match, | 429 AutocompleteMatch* match, |
429 GURL* alternate_nav_url) const; | 430 GURL* alternate_nav_url) const; |
430 | 431 |
431 // If focus_state_ does not match |state|, we update it and notify the | 432 // If focus_state_ does not match |state|, we update it and notify the |
432 // InstantController about the change (passing along the |reason| for the | 433 // InstantController about the change (passing along the |reason| for the |
433 // change). If the caret visibility changes, we call ApplyCaretVisibility() on | 434 // change). If the caret visibility changes, we call ApplyCaretVisibility() on |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 557 |
557 // The input that was sent to the AutocompleteController. Since no | 558 // The input that was sent to the AutocompleteController. Since no |
558 // autocomplete query is started after a tab switch, it is possible for this | 559 // autocomplete query is started after a tab switch, it is possible for this |
559 // |input_| to differ from the one currently stored in AutocompleteController. | 560 // |input_| to differ from the one currently stored in AutocompleteController. |
560 AutocompleteInput input_; | 561 AutocompleteInput input_; |
561 | 562 |
562 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 563 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
563 }; | 564 }; |
564 | 565 |
565 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 566 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
OLD | NEW |