| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool escape_pressed, | 94 bool escape_pressed, |
| 95 bool is_keyword_search); | 95 bool is_keyword_search); |
| 96 | 96 |
| 97 // Releases and returns the NTP WebContents. May be NULL. Loads a new | 97 // Releases and returns the NTP WebContents. May be NULL. Loads a new |
| 98 // WebContents for the NTP. | 98 // WebContents for the NTP. |
| 99 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT; | 99 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT; |
| 100 | 100 |
| 101 // Sets the bounds of the omnibox popup, in screen coordinates. | 101 // Sets the bounds of the omnibox popup, in screen coordinates. |
| 102 void SetPopupBounds(const gfx::Rect& bounds); | 102 void SetPopupBounds(const gfx::Rect& bounds); |
| 103 | 103 |
| 104 // Sets the start and end margins of the omnibox text area. | 104 // Sets the stored start-edge margin and width of the omnibox. |
| 105 void SetMarginSize(int start, int end); | 105 void SetStartMarginAndWidth(int margin, int width); |
| 106 | 106 |
| 107 // Send autocomplete results from |providers| to the preview page. | 107 // Send autocomplete results from |providers| to the preview page. |
| 108 void HandleAutocompleteResults( | 108 void HandleAutocompleteResults( |
| 109 const std::vector<AutocompleteProvider*>& providers); | 109 const std::vector<AutocompleteProvider*>& providers); |
| 110 | 110 |
| 111 // Called when the user presses up or down. |count| is a repeat count, | 111 // Called when the user presses up or down. |count| is a repeat count, |
| 112 // negative for moving up, positive for moving down. Returns true if Instant | 112 // negative for moving up, positive for moving down. Returns true if Instant |
| 113 // handled the key press. | 113 // handled the key press. |
| 114 bool OnUpOrDownKeyPressed(int count); | 114 bool OnUpOrDownKeyPressed(int count); |
| 115 | 115 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 392 |
| 393 // The search model mode for the active tab. | 393 // The search model mode for the active tab. |
| 394 chrome::search::Mode search_mode_; | 394 chrome::search::Mode search_mode_; |
| 395 | 395 |
| 396 // Current omnibox popup bounds. | 396 // Current omnibox popup bounds. |
| 397 gfx::Rect popup_bounds_; | 397 gfx::Rect popup_bounds_; |
| 398 | 398 |
| 399 // Last popup bounds passed to the page. | 399 // Last popup bounds passed to the page. |
| 400 gfx::Rect last_popup_bounds_; | 400 gfx::Rect last_popup_bounds_; |
| 401 | 401 |
| 402 // Size of the start-edge omnibox text area margin. | 402 // The start-edge margin and width of the omnibox, used by the page to align |
| 403 int start_margin_; | 403 // its suggestions with the omnibox. |
| 404 | 404 int omnibox_start_margin_; |
| 405 // Size of the end-edge omnibox text area margin. | 405 int omnibox_width_; |
| 406 int end_margin_; | |
| 407 | 406 |
| 408 // Timer used to update the bounds of the omnibox popup. | 407 // Timer used to update the bounds of the omnibox popup. |
| 409 base::OneShotTimer<InstantController> update_bounds_timer_; | 408 base::OneShotTimer<InstantController> update_bounds_timer_; |
| 410 | 409 |
| 411 // For each key K => value N, the map says that we found that the search | 410 // For each key K => value N, the map says that we found that the search |
| 412 // engine identified by Instant URL K didn't support the Instant API, or | 411 // engine identified by Instant URL K didn't support the Instant API, or |
| 413 // caused RenderView crashes in each of the last N times that we loaded it. | 412 // caused RenderView crashes in each of the last N times that we loaded it. |
| 414 // If an Instant URL isn't present in the map at all or has a value 0, | 413 // If an Instant URL isn't present in the map at all or has a value 0, |
| 415 // it means that search engine supports the Instant API (or we assume it does, | 414 // it means that search engine supports the Instant API (or we assume it does, |
| 416 // since we haven't determined it doesn't) and it did not cause a crash. | 415 // since we haven't determined it doesn't) and it did not cause a crash. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 438 // Used for Top Sites async retrieval. | 437 // Used for Top Sites async retrieval. |
| 439 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 438 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
| 440 | 439 |
| 441 // Used to get notifications about Most Visted changes. | 440 // Used to get notifications about Most Visted changes. |
| 442 content::NotificationRegistrar registrar_; | 441 content::NotificationRegistrar registrar_; |
| 443 | 442 |
| 444 DISALLOW_COPY_AND_ASSIGN(InstantController); | 443 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 445 }; | 444 }; |
| 446 | 445 |
| 447 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 446 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |