Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: chrome/browser/instant/instant_controller.h

Issue 12047107: Change the SearchBox API from using the start/end margins of the location bar to using the start ma… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool escape_pressed, 89 bool escape_pressed,
90 bool is_keyword_search); 90 bool is_keyword_search);
91 91
92 // Releases and returns the NTP WebContents. May be NULL. Loads a new 92 // Releases and returns the NTP WebContents. May be NULL. Loads a new
93 // WebContents for the NTP. 93 // WebContents for the NTP.
94 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT; 94 scoped_ptr<content::WebContents> ReleaseNTPContents() WARN_UNUSED_RESULT;
95 95
96 // Sets the bounds of the omnibox popup, in screen coordinates. 96 // Sets the bounds of the omnibox popup, in screen coordinates.
97 void SetPopupBounds(const gfx::Rect& bounds); 97 void SetPopupBounds(const gfx::Rect& bounds);
98 98
99 // Sets the start and end margins of the omnibox text area. 99 // Sets the stored start-edge margin and width of the omnibox.
100 void SetMarginSize(int start, int end); 100 void SetStartMarginAndWidth(int margin, int width);
101 101
102 // Send autocomplete results from |providers| to the preview page. 102 // Send autocomplete results from |providers| to the preview page.
103 void HandleAutocompleteResults( 103 void HandleAutocompleteResults(
104 const std::vector<AutocompleteProvider*>& providers); 104 const std::vector<AutocompleteProvider*>& providers);
105 105
106 // Called when the user presses up or down. |count| is a repeat count, 106 // Called when the user presses up or down. |count| is a repeat count,
107 // negative for moving up, positive for moving down. Returns true if Instant 107 // negative for moving up, positive for moving down. Returns true if Instant
108 // handled the key press. 108 // handled the key press.
109 bool OnUpOrDownKeyPressed(int count); 109 bool OnUpOrDownKeyPressed(int count);
110 110
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 // The search model mode for the active tab. 350 // The search model mode for the active tab.
351 chrome::search::Mode search_mode_; 351 chrome::search::Mode search_mode_;
352 352
353 // Current omnibox popup bounds. 353 // Current omnibox popup bounds.
354 gfx::Rect popup_bounds_; 354 gfx::Rect popup_bounds_;
355 355
356 // Last popup bounds passed to the page. 356 // Last popup bounds passed to the page.
357 gfx::Rect last_popup_bounds_; 357 gfx::Rect last_popup_bounds_;
358 358
359 // Size of the start-edge omnibox text area margin. 359 // The start-edge margin and width of the omnibox, used by the page to align
360 int start_margin_; 360 // its suggestions with the omnibox.
361 361 int omnibox_start_margin_;
362 // Size of the end-edge omnibox text area margin. 362 int omnibox_width_;
363 int end_margin_;
364 363
365 // Timer used to update the bounds of the omnibox popup. 364 // Timer used to update the bounds of the omnibox popup.
366 base::OneShotTimer<InstantController> update_bounds_timer_; 365 base::OneShotTimer<InstantController> update_bounds_timer_;
367 366
368 // For each key K => value N, the map says that we found that the search 367 // For each key K => value N, the map says that we found that the search
369 // engine identified by Instant URL K didn't support the Instant API, or 368 // engine identified by Instant URL K didn't support the Instant API, or
370 // caused RenderView crashes in each of the last N times that we loaded it. 369 // caused RenderView crashes in each of the last N times that we loaded it.
371 // If an Instant URL isn't present in the map at all or has a value 0, 370 // If an Instant URL isn't present in the map at all or has a value 0,
372 // it means that search engine supports the Instant API (or we assume it does, 371 // it means that search engine supports the Instant API (or we assume it does,
373 // since we haven't determined it doesn't) and it did not cause a crash. 372 // since we haven't determined it doesn't) and it did not cause a crash.
(...skipping 15 matching lines...) Expand all
389 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. 388 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false.
390 bool allow_preview_to_show_search_suggestions_; 389 bool allow_preview_to_show_search_suggestions_;
391 390
392 // List of events and their timestamps, useful in debugging Instant behaviour. 391 // List of events and their timestamps, useful in debugging Instant behaviour.
393 mutable std::list<std::pair<int64, std::string> > debug_events_; 392 mutable std::list<std::pair<int64, std::string> > debug_events_;
394 393
395 DISALLOW_COPY_AND_ASSIGN(InstantController); 394 DISALLOW_COPY_AND_ASSIGN(InstantController);
396 }; 395 };
397 396
398 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ 397 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.cc » ('j') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698