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

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: Added test 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 size_t selection_end, 74 size_t selection_end,
75 bool verbatim, 75 bool verbatim,
76 bool user_input_in_progress, 76 bool user_input_in_progress,
77 bool omnibox_popup_is_open, 77 bool omnibox_popup_is_open,
78 bool escape_pressed, 78 bool escape_pressed,
79 bool is_keyword_search); 79 bool is_keyword_search);
80 80
81 // Sets the bounds of the omnibox popup, in screen coordinates. 81 // Sets the bounds of the omnibox popup, in screen coordinates.
82 void SetPopupBounds(const gfx::Rect& bounds); 82 void SetPopupBounds(const gfx::Rect& bounds);
83 83
84 // Sets the start and end margins of the omnibox text area. 84 // Sets the stored start-edge margin and width.
85 void SetMarginSize(int start, int end); 85 void SetStartMarginAndWidth(int margin, int width);
86 86
87 // Send autocomplete results from |providers| to the preview page. 87 // Send autocomplete results from |providers| to the preview page.
88 void HandleAutocompleteResults( 88 void HandleAutocompleteResults(
89 const std::vector<AutocompleteProvider*>& providers); 89 const std::vector<AutocompleteProvider*>& providers);
90 90
91 // Called when the user presses up or down. |count| is a repeat count, 91 // Called when the user presses up or down. |count| is a repeat count,
92 // negative for moving up, positive for moving down. Returns true if Instant 92 // negative for moving up, positive for moving down. Returns true if Instant
93 // handled the key press. 93 // handled the key press.
94 bool OnUpOrDownKeyPressed(int count); 94 bool OnUpOrDownKeyPressed(int count);
95 95
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 // The search model mode for the active tab. 316 // The search model mode for the active tab.
317 chrome::search::Mode search_mode_; 317 chrome::search::Mode search_mode_;
318 318
319 // Current omnibox popup bounds. 319 // Current omnibox popup bounds.
320 gfx::Rect popup_bounds_; 320 gfx::Rect popup_bounds_;
321 321
322 // Last popup bounds passed to the page. 322 // Last popup bounds passed to the page.
323 gfx::Rect last_popup_bounds_; 323 gfx::Rect last_popup_bounds_;
324 324
325 // Size of the start-edge omnibox text area margin. 325 // The start-edge margin and width to use for aligning the preview contents
326 // with the omnibox.
326 int start_margin_; 327 int start_margin_;
327 328 int width_;
328 // Size of the end-edge omnibox text area margin.
329 int end_margin_;
330 329
331 // Timer used to update the bounds of the omnibox popup. 330 // Timer used to update the bounds of the omnibox popup.
332 base::OneShotTimer<InstantController> update_bounds_timer_; 331 base::OneShotTimer<InstantController> update_bounds_timer_;
333 332
334 // Timer used to ensure that the Instant page does not get too stale. 333 // Timer used to ensure that the Instant page does not get too stale.
335 base::OneShotTimer<InstantController> stale_loader_timer_; 334 base::OneShotTimer<InstantController> stale_loader_timer_;
336 335
337 // For each key K => value N, the map says that we found that the search 336 // For each key K => value N, the map says that we found that the search
338 // engine identified by Instant URL K didn't support the Instant API, or 337 // engine identified by Instant URL K didn't support the Instant API, or
339 // caused RenderView crashes in each of the last N times that we loaded it. 338 // caused RenderView crashes in each of the last N times that we loaded it.
(...skipping 18 matching lines...) Expand all
358 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. 357 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false.
359 bool allow_preview_to_show_search_suggestions_; 358 bool allow_preview_to_show_search_suggestions_;
360 359
361 // List of events and their timestamps, useful in debugging Instant behaviour. 360 // List of events and their timestamps, useful in debugging Instant behaviour.
362 mutable std::list<std::pair<int64, std::string> > debug_events_; 361 mutable std::list<std::pair<int64, std::string> > debug_events_;
363 362
364 DISALLOW_COPY_AND_ASSIGN(InstantController); 363 DISALLOW_COPY_AND_ASSIGN(InstantController);
365 }; 364 };
366 365
367 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ 366 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698