| 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 SetOmniboxBounds(const gfx::Rect& bounds); |
| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 // The search model mode for the active tab. | 395 // The search model mode for the active tab. |
| 396 chrome::search::Mode search_mode_; | 396 chrome::search::Mode search_mode_; |
| 397 | 397 |
| 398 // Current omnibox popup bounds. | 398 // Current omnibox popup bounds. |
| 399 gfx::Rect popup_bounds_; | 399 gfx::Rect popup_bounds_; |
| 400 | 400 |
| 401 // Last popup bounds passed to the page. | 401 // Last popup bounds passed to the page. |
| 402 gfx::Rect last_popup_bounds_; | 402 gfx::Rect last_popup_bounds_; |
| 403 | 403 |
| 404 // Size of the start-edge omnibox text area margin. | 404 // The start-edge margin and width of the omnibox, used by the page to align |
| 405 int start_margin_; | 405 // its suggestions with the omnibox. |
| 406 | 406 gfx::Rect omnibox_bounds_; |
| 407 // Size of the end-edge omnibox text area margin. | |
| 408 int end_margin_; | |
| 409 | 407 |
| 410 // Timer used to update the bounds of the omnibox popup. | 408 // Timer used to update the bounds of the omnibox popup. |
| 411 base::OneShotTimer<InstantController> update_bounds_timer_; | 409 base::OneShotTimer<InstantController> update_bounds_timer_; |
| 412 | 410 |
| 413 // For each key K => value N, the map says that we found that the search | 411 // For each key K => value N, the map says that we found that the search |
| 414 // engine identified by Instant URL K didn't support the Instant API, or | 412 // engine identified by Instant URL K didn't support the Instant API, or |
| 415 // caused RenderView crashes in each of the last N times that we loaded it. | 413 // caused RenderView crashes in each of the last N times that we loaded it. |
| 416 // If an Instant URL isn't present in the map at all or has a value 0, | 414 // If an Instant URL isn't present in the map at all or has a value 0, |
| 417 // it means that search engine supports the Instant API (or we assume it does, | 415 // it means that search engine supports the Instant API (or we assume it does, |
| 418 // since we haven't determined it doesn't) and it did not cause a crash. | 416 // since we haven't determined it doesn't) and it did not cause a crash. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 440 // Used for Top Sites async retrieval. | 438 // Used for Top Sites async retrieval. |
| 441 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 439 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
| 442 | 440 |
| 443 // Used to get notifications about Most Visted changes. | 441 // Used to get notifications about Most Visted changes. |
| 444 content::NotificationRegistrar registrar_; | 442 content::NotificationRegistrar registrar_; |
| 445 | 443 |
| 446 DISALLOW_COPY_AND_ASSIGN(InstantController); | 444 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 447 }; | 445 }; |
| 448 | 446 |
| 449 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 447 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |