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 SetOmniboxBounds(const gfx::Rect& bounds); | 66 void SetPopupBounds(const gfx::Rect& bounds); |
| 67 |
| 68 // Tells the preview page what size margins to use. Both |start| and |end| |
| 69 // are offsets from the start edge of the page delimiting the horizontal |
| 70 // bounds of the page text area. |
| 71 void SetMarginSize(int start, int end); |
67 | 72 |
68 // Tells the preview page about the available autocomplete results. | 73 // Tells the preview page about the available autocomplete results. |
69 void SendAutocompleteResults( | 74 void SendAutocompleteResults( |
70 const std::vector<InstantAutocompleteResult>& results); | 75 const std::vector<InstantAutocompleteResult>& results); |
71 | 76 |
72 // Tells the preview page that the user pressed the up or down key. |count| | 77 // 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. | 78 // is a repeat count, negative for moving up, positive for moving down. |
74 void OnUpOrDownKeyPressed(int count); | 79 void OnUpOrDownKeyPressed(int count); |
75 | 80 |
76 // Tells the preview page that the searchbox has been focused. | 81 // Tells the preview page that the searchbox has been focused. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Used to get notifications about renderers coming and going. | 154 // Used to get notifications about renderers coming and going. |
150 content::NotificationRegistrar registrar_; | 155 content::NotificationRegistrar registrar_; |
151 | 156 |
152 // See comments on the getter above. | 157 // See comments on the getter above. |
153 history::HistoryAddPageArgs last_navigation_; | 158 history::HistoryAddPageArgs last_navigation_; |
154 | 159 |
155 DISALLOW_COPY_AND_ASSIGN(InstantLoader); | 160 DISALLOW_COPY_AND_ASSIGN(InstantLoader); |
156 }; | 161 }; |
157 | 162 |
158 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ | 163 #endif // CHROME_BROWSER_INSTANT_INSTANT_LOADER_H_ |
OLD | NEW |