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

Side by Side Diff: chrome/renderer/searchbox/searchbox.h

Issue 11413018: alternate ntp: implement searchbox api for instant overlay to adopt themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed scott's comments Created 8 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_RENDERER_SEARCHBOX_SEARCHBOX_H_ 5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 30 matching lines...) Expand all
41 size_t selection_start() const { return selection_start_; } 41 size_t selection_start() const { return selection_start_; }
42 size_t selection_end() const { return selection_end_; } 42 size_t selection_end() const { return selection_end_; }
43 int results_base() const { return results_base_; } 43 int results_base() const { return results_base_; }
44 bool active_tab_is_ntp() const { return active_tab_is_ntp_; } 44 bool active_tab_is_ntp() const { return active_tab_is_ntp_; }
45 45
46 gfx::Rect GetRect(); 46 gfx::Rect GetRect();
47 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); 47 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults();
48 // Searchbox retains ownership of this object. 48 // Searchbox retains ownership of this object.
49 const InstantAutocompleteResult* 49 const InstantAutocompleteResult*
50 GetAutocompleteResultWithId(size_t restricted_id) const; 50 GetAutocompleteResultWithId(size_t restricted_id) const;
51 const ThemeBackgroundInfo& GetThemeBackgroundInfo();
52 int GetThemeAreaHeight();
51 53
52 private: 54 private:
53 // RenderViewObserver implementation. 55 // RenderViewObserver implementation.
54 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
55 57
56 void OnChange(const string16& query, 58 void OnChange(const string16& query,
57 bool verbatim, 59 bool verbatim,
58 size_t selection_start, 60 size_t selection_start,
59 size_t selection_end); 61 size_t selection_end);
60 void OnSubmit(const string16& query); 62 void OnSubmit(const string16& query);
61 void OnCancel(const string16& query); 63 void OnCancel(const string16& query);
62 void OnResize(const gfx::Rect& bounds); 64 void OnResize(const gfx::Rect& bounds);
63 void OnDetermineIfPageSupportsInstant(); 65 void OnDetermineIfPageSupportsInstant();
64 void OnAutocompleteResults( 66 void OnAutocompleteResults(
65 const std::vector<InstantAutocompleteResult>& results); 67 const std::vector<InstantAutocompleteResult>& results);
66 void OnUpOrDownKeyPressed(int count); 68 void OnUpOrDownKeyPressed(int count);
67 void OnFocus(); 69 void OnFocus();
68 void OnBlur(); 70 void OnBlur();
69 void OnActiveTabModeChanged(bool active_tab_is_ntp); 71 void OnActiveTabModeChanged(bool active_tab_is_ntp);
72 void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
73 void OnThemeAreaHeightChanged(int height);
70 74
71 // Sets the searchbox values to their initial value. 75 // Sets the searchbox values to their initial value.
72 void Reset(); 76 void Reset();
73 77
74 string16 query_; 78 string16 query_;
75 bool verbatim_; 79 bool verbatim_;
76 size_t selection_start_; 80 size_t selection_start_;
77 size_t selection_end_; 81 size_t selection_end_;
78 size_t results_base_; 82 size_t results_base_;
79 gfx::Rect rect_; 83 gfx::Rect rect_;
80 std::vector<InstantAutocompleteResult> autocomplete_results_; 84 std::vector<InstantAutocompleteResult> autocomplete_results_;
81 size_t last_results_base_; 85 size_t last_results_base_;
82 std::vector<InstantAutocompleteResult> last_autocomplete_results_; 86 std::vector<InstantAutocompleteResult> last_autocomplete_results_;
83 bool active_tab_is_ntp_; 87 bool active_tab_is_ntp_;
88 ThemeBackgroundInfo theme_info_;
89 int theme_area_height_;
84 90
85 DISALLOW_COPY_AND_ASSIGN(SearchBox); 91 DISALLOW_COPY_AND_ASSIGN(SearchBox);
86 }; 92 };
87 93
88 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 94 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698