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_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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Initializes |preview_contents_| and loads |instant_url_|. | 54 // Initializes |preview_contents_| and loads |instant_url_|. |
55 void Init(); | 55 void Init(); |
56 | 56 |
57 // Tells the preview page that the user typed |user_text| into the omnibox. | 57 // Tells the preview page that the user typed |user_text| into the omnibox. |
58 // If |verbatim| is false, the page predicts the query the user means to type | 58 // If |verbatim| is false, the page predicts the query the user means to type |
59 // and fetches results for the prediction. If |verbatim| is true, |user_text| | 59 // and fetches results for the prediction. If |verbatim| is true, |user_text| |
60 // is taken as the exact query (no prediction is made). | 60 // is taken as the exact query (no prediction is made). |
61 void Update(const string16& user_text, bool verbatim); | 61 void Update(const string16& user_text, bool verbatim); |
62 | 62 |
63 // Tells the preview page of the bounds of the omnibox dropdown (in screen | 63 // Tells the preview page of the bounds of the omnibox popup (in screen |
64 // coordinates). This is used by the page to offset the results to avoid them | 64 // coordinates). This is used by the page to offset the results to avoid them |
65 // being covered by the omnibox dropdown. | 65 // being covered by the omnibox dropdown. |
| 66 void SetPopupBounds(const gfx::Rect& bounds); |
| 67 |
| 68 // Tells the preview page of the bounds of the omnibox itself in screen |
| 69 // coordinates. This is used by the page to determine page margin widths. |
66 void SetOmniboxBounds(const gfx::Rect& bounds); | 70 void SetOmniboxBounds(const gfx::Rect& bounds); |
67 | 71 |
68 // Tells the preview page about the available autocomplete results. | 72 // Tells the preview page about the available autocomplete results. |
69 void SendAutocompleteResults( | 73 void SendAutocompleteResults( |
70 const std::vector<InstantAutocompleteResult>& results); | 74 const std::vector<InstantAutocompleteResult>& results); |
71 | 75 |
72 // Tells the preview page that the user pressed the up or down key. |count| | 76 // Tells the preview page that the user pressed the up or down key. |count| |
73 // is a repeat count, negative for moving up, positive for moving down. | 77 // is a repeat count, negative for moving up, positive for moving down. |
74 void OnUpOrDownKeyPressed(int count); | 78 void OnUpOrDownKeyPressed(int count); |
75 | 79 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Used to get notifications about renderers coming and going. | 153 // Used to get notifications about renderers coming and going. |
150 content::NotificationRegistrar registrar_; | 154 content::NotificationRegistrar registrar_; |
151 | 155 |
152 // See comments on the getter above. | 156 // See comments on the getter above. |
153 history::HistoryAddPageArgs last_navigation_; | 157 history::HistoryAddPageArgs last_navigation_; |
154 | 158 |
155 DISALLOW_COPY_AND_ASSIGN(InstantLoader); | 159 DISALLOW_COPY_AND_ASSIGN(InstantLoader); |
156 }; | 160 }; |
157 | 161 |
158 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 162 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
OLD | NEW |