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_NAVIGATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_NAVIGATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_NAVIGATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_NAVIGATION_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/autocomplete/autocomplete_match.h" | 12 #include "chrome/browser/autocomplete/autocomplete_match.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
17 | 17 |
18 namespace history { | |
19 class ShortcutsBackend; | 18 class ShortcutsBackend; |
20 } | |
21 | 19 |
22 namespace net { | 20 namespace net { |
23 class URLFetcher; | 21 class URLFetcher; |
24 class URLRequestStatus; | 22 class URLRequestStatus; |
25 } | 23 } |
26 | 24 |
27 // Monitors omnibox navigations in order to trigger behaviors that depend on | 25 // Monitors omnibox navigations in order to trigger behaviors that depend on |
28 // successful navigations. | 26 // successful navigations. |
29 // | 27 // |
30 // Currently two such behaviors exist: | 28 // Currently two such behaviors exist: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 // net::URLFetcherDelegate: | 88 // net::URLFetcherDelegate: |
91 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 89 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
92 | 90 |
93 // Once the load has committed and any URL fetch has completed, this displays | 91 // Once the load has committed and any URL fetch has completed, this displays |
94 // the alternate nav infobar if necessary, and deletes |this|. | 92 // the alternate nav infobar if necessary, and deletes |this|. |
95 void OnAllLoadingFinished(); | 93 void OnAllLoadingFinished(); |
96 | 94 |
97 const base::string16 text_; | 95 const base::string16 text_; |
98 const AutocompleteMatch match_; | 96 const AutocompleteMatch match_; |
99 const AutocompleteMatch alternate_nav_match_; | 97 const AutocompleteMatch alternate_nav_match_; |
100 scoped_refptr<history::ShortcutsBackend> shortcuts_backend_; // May be NULL | 98 scoped_refptr<ShortcutsBackend> shortcuts_backend_; // May be NULL in |
Anuj
2014/03/15 00:51:05
May be? I think it should be NULL in incognito.
Peter Kasting
2014/03/17 18:36:44
Done.
| |
101 // in incognito. | 99 // incognito. |
102 scoped_ptr<net::URLFetcher> fetcher_; | 100 scoped_ptr<net::URLFetcher> fetcher_; |
103 LoadState load_state_; | 101 LoadState load_state_; |
104 FetchState fetch_state_; | 102 FetchState fetch_state_; |
105 | 103 |
106 content::NotificationRegistrar registrar_; | 104 content::NotificationRegistrar registrar_; |
107 | 105 |
108 DISALLOW_COPY_AND_ASSIGN(OmniboxNavigationObserver); | 106 DISALLOW_COPY_AND_ASSIGN(OmniboxNavigationObserver); |
109 }; | 107 }; |
110 | 108 |
111 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_NAVIGATION_OBSERVER_H_ | 109 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_NAVIGATION_OBSERVER_H_ |
OLD | NEW |