Chromium Code Reviews| 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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 bool escape_pressed, | 92 bool escape_pressed, |
| 93 bool is_keyword_search); | 93 bool is_keyword_search); |
| 94 | 94 |
| 95 // Releases and returns the NTP WebContents. May be NULL. Loads a new | 95 // Releases and returns the NTP WebContents. May be NULL. Loads a new |
| 96 // WebContents for the NTP. | 96 // WebContents for the NTP. |
| 97 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT; | 97 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT; |
| 98 | 98 |
| 99 // Sets the bounds of the omnibox popup, in screen coordinates. | 99 // Sets the bounds of the omnibox popup, in screen coordinates. |
| 100 void SetPopupBounds(const gfx::Rect& bounds); | 100 void SetPopupBounds(const gfx::Rect& bounds); |
| 101 | 101 |
| 102 // Sets the start and end margins of the omnibox text area. | 102 // Sets the stored start-edge margin and width of the omnibox. |
| 103 void SetMarginSize(int start, int end); | 103 void SetStartMarginAndWidth(int margin, int width); |
| 104 | 104 |
| 105 // Send autocomplete results from |providers| to the preview page. | 105 // Send autocomplete results from |providers| to the preview page. |
| 106 void HandleAutocompleteResults( | 106 void HandleAutocompleteResults( |
| 107 const std::vector<AutocompleteProvider*>& providers); | 107 const std::vector<AutocompleteProvider*>& providers); |
| 108 | 108 |
| 109 // Called when the user presses up or down. |count| is a repeat count, | 109 // Called when the user presses up or down. |count| is a repeat count, |
| 110 // negative for moving up, positive for moving down. Returns true if Instant | 110 // negative for moving up, positive for moving down. Returns true if Instant |
| 111 // handled the key press. | 111 // handled the key press. |
| 112 bool OnUpOrDownKeyPressed(int count); | 112 bool OnUpOrDownKeyPressed(int count); |
| 113 | 113 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 | 348 |
| 349 // The search model mode for the active tab. | 349 // The search model mode for the active tab. |
| 350 chrome::search::Mode search_mode_; | 350 chrome::search::Mode search_mode_; |
| 351 | 351 |
| 352 // Current omnibox popup bounds. | 352 // Current omnibox popup bounds. |
| 353 gfx::Rect popup_bounds_; | 353 gfx::Rect popup_bounds_; |
| 354 | 354 |
| 355 // Last popup bounds passed to the page. | 355 // Last popup bounds passed to the page. |
| 356 gfx::Rect last_popup_bounds_; | 356 gfx::Rect last_popup_bounds_; |
| 357 | 357 |
| 358 // Size of the start-edge omnibox text area margin. | 358 // The start-edge margin and width of the omnibox, used by the page align its |
|
sreeram
2013/02/20 15:40:10
page align -> page to align
melevin
2013/02/20 20:11:45
Done.
| |
| 359 int start_margin_; | 359 // suggestions with the omnibox. |
| 360 | 360 int omnibox_start_margin_; |
| 361 // Size of the end-edge omnibox text area margin. | 361 int omnibox_width_; |
| 362 int end_margin_; | |
| 363 | 362 |
| 364 // Timer used to update the bounds of the omnibox popup. | 363 // Timer used to update the bounds of the omnibox popup. |
| 365 base::OneShotTimer<InstantController> update_bounds_timer_; | 364 base::OneShotTimer<InstantController> update_bounds_timer_; |
| 366 | 365 |
| 367 // For each key K => value N, the map says that we found that the search | 366 // For each key K => value N, the map says that we found that the search |
| 368 // engine identified by Instant URL K didn't support the Instant API, or | 367 // engine identified by Instant URL K didn't support the Instant API, or |
| 369 // caused RenderView crashes in each of the last N times that we loaded it. | 368 // caused RenderView crashes in each of the last N times that we loaded it. |
| 370 // If an Instant URL isn't present in the map at all or has a value 0, | 369 // If an Instant URL isn't present in the map at all or has a value 0, |
| 371 // it means that search engine supports the Instant API (or we assume it does, | 370 // it means that search engine supports the Instant API (or we assume it does, |
| 372 // since we haven't determined it doesn't) and it did not cause a crash. | 371 // since we haven't determined it doesn't) and it did not cause a crash. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 388 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 387 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
| 389 bool allow_preview_to_show_search_suggestions_; | 388 bool allow_preview_to_show_search_suggestions_; |
| 390 | 389 |
| 391 // List of events and their timestamps, useful in debugging Instant behaviour. | 390 // List of events and their timestamps, useful in debugging Instant behaviour. |
| 392 mutable std::list<std::pair<int64, std::string> > debug_events_; | 391 mutable std::list<std::pair<int64, std::string> > debug_events_; |
| 393 | 392 |
| 394 DISALLOW_COPY_AND_ASSIGN(InstantController); | 393 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 395 }; | 394 }; |
| 396 | 395 |
| 397 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 396 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |