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_INSTANT_INSTANT_LOADER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 bool is_pointer_down_from_activate() const { | 75 bool is_pointer_down_from_activate() const { |
76 return is_pointer_down_from_activate_; | 76 return is_pointer_down_from_activate_; |
77 } | 77 } |
78 | 78 |
79 // Returns info about the last navigation by the Instant page. If the page | 79 // Returns info about the last navigation by the Instant page. If the page |
80 // hasn't navigated since the last Update(), the URL is empty. | 80 // hasn't navigated since the last Update(), the URL is empty. |
81 const history::HistoryAddPageArgs& last_navigation() const { | 81 const history::HistoryAddPageArgs& last_navigation() const { |
82 return last_navigation_; | 82 return last_navigation_; |
83 } | 83 } |
84 | 84 |
85 // Tells the loader that it is in fallback mode. | |
86 void set_is_in_fallback_mode(bool value); | |
87 bool is_in_fallback_mode() const { return is_in_fallback_mode_; } | |
sreeram
2013/01/22 03:58:03
Do we really need this? Can't we just use IsUsingL
Shishir
2013/01/25 22:11:26
There are a couple of reasons why I think its bett
sreeram
2013/01/29 17:02:21
Re: 1, I don't see the need to distinguish the cas
Shishir
2013/01/29 20:06:31
As discussed, we want to keep the EnsureLoaderIsCu
| |
88 | |
85 // Called by the history tab helper with information that it would have added | 89 // Called by the history tab helper with information that it would have added |
86 // to the history service had this WebContents not been used for Instant. | 90 // to the history service had this WebContents not been used for Instant. |
87 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); | 91 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); |
88 | 92 |
89 // Returns true if the loader is using | 93 // Returns true if the loader is using |
90 // InstantController::kLocalOmniboxPopupURL as the |instant_url_|. | 94 // InstantController::kLocalOmniboxPopupURL as the |instant_url_|. |
91 bool IsUsingLocalPreview() const; | 95 bool IsUsingLocalPreview() const; |
92 | 96 |
93 // Calls through to methods of the same name on InstantClient. | 97 // Calls through to methods of the same name on InstantClient. |
94 void Update(const string16& text, | 98 void Update(const string16& text, |
95 size_t selection_start, | 99 size_t selection_start, |
96 size_t selection_end, | 100 size_t selection_end, |
97 bool verbatim); | 101 bool verbatim); |
98 void Submit(const string16& text); | 102 void Submit(const string16& text); |
99 void Cancel(const string16& text); | 103 void Cancel(const string16& text); |
100 void SetPopupBounds(const gfx::Rect& bounds); | 104 void SetPopupBounds(const gfx::Rect& bounds); |
101 void SetMarginSize(int start, int end); | 105 void SetMarginSize(int start, int end); |
106 void InitializeFonts(); | |
sreeram
2013/01/22 03:58:03
I realize that the reason why this was being done
Shishir
2013/01/25 22:11:26
As we discussed, the font information will now alw
| |
102 void SendAutocompleteResults( | 107 void SendAutocompleteResults( |
103 const std::vector<InstantAutocompleteResult>& results); | 108 const std::vector<InstantAutocompleteResult>& results); |
104 void UpOrDownKeyPressed(int count); | 109 void UpOrDownKeyPressed(int count); |
105 void SearchModeChanged(const chrome::search::Mode& mode); | 110 void SearchModeChanged(const chrome::search::Mode& mode); |
106 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info); | 111 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info); |
107 void SendThemeAreaHeight(int height); | 112 void SendThemeAreaHeight(int height); |
108 void SetDisplayInstantResults(bool display_instant_results); | 113 void SetDisplayInstantResults(bool display_instant_results); |
109 void KeyCaptureChanged(bool is_key_capture_enabled); | 114 void KeyCaptureChanged(bool is_key_capture_enabled); |
110 | 115 |
111 private: | 116 private: |
(...skipping 29 matching lines...) Expand all Loading... | |
141 // Delegate of the preview WebContents. Used when the user does some gesture | 146 // Delegate of the preview WebContents. Used when the user does some gesture |
142 // on the preview and it needs to be activated. | 147 // on the preview and it needs to be activated. |
143 scoped_ptr<WebContentsDelegateImpl> delegate_; | 148 scoped_ptr<WebContentsDelegateImpl> delegate_; |
144 scoped_ptr<content::WebContents> contents_; | 149 scoped_ptr<content::WebContents> contents_; |
145 | 150 |
146 const std::string instant_url_; | 151 const std::string instant_url_; |
147 bool supports_instant_; | 152 bool supports_instant_; |
148 bool is_pointer_down_from_activate_; | 153 bool is_pointer_down_from_activate_; |
149 history::HistoryAddPageArgs last_navigation_; | 154 history::HistoryAddPageArgs last_navigation_; |
150 | 155 |
156 // Indicates if this loader is running as a fallback loader using the local | |
157 // preview because the actual instant page was too slow to load. | |
158 bool is_in_fallback_mode_; | |
159 | |
151 // Used to get notifications about renderers coming and going. | 160 // Used to get notifications about renderers coming and going. |
152 content::NotificationRegistrar registrar_; | 161 content::NotificationRegistrar registrar_; |
153 | 162 |
154 DISALLOW_COPY_AND_ASSIGN(InstantLoader); | 163 DISALLOW_COPY_AND_ASSIGN(InstantLoader); |
155 }; | 164 }; |
156 | 165 |
157 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 166 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
OLD | NEW |