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

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

Issue 10825304: Creating a new directory chrome/renderer/searchbox and moving appropriate code to it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removing sky from OWNERS. Created 8 years, 4 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
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/searchbox.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_SEARCHBOX_H_
6 #define CHROME_RENDERER_SEARCHBOX_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/string16.h"
12 #include "chrome/common/instant_types.h"
13 #include "content/public/renderer/render_view_observer.h"
14 #include "content/public/renderer/render_view_observer_tracker.h"
15 #include "ui/gfx/rect.h"
16
17 namespace content {
18 class RenderView;
19 }
20
21 namespace IPC {
22 class Message;
23 }
24
25 class SearchBox : public content::RenderViewObserver,
26 public content::RenderViewObserverTracker<SearchBox> {
27 public:
28 explicit SearchBox(content::RenderView* render_view);
29 virtual ~SearchBox();
30
31 // Sends ViewHostMsg_SetSuggestions to the browser.
32 void SetSuggestions(const std::vector<string16>& suggestions,
33 InstantCompleteBehavior behavior);
34
35 const string16& value() const { return value_; }
36 bool verbatim() const { return verbatim_; }
37 size_t selection_start() const { return selection_start_; }
38 size_t selection_end() const { return selection_end_; }
39 gfx::Rect GetRect();
40
41 private:
42 // RenderViewObserver implementation.
43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
44
45 void OnChange(const string16& value,
46 bool verbatim,
47 size_t selection_start,
48 size_t selection_end);
49 void OnSubmit(const string16& value);
50 void OnCancel(const string16& value);
51 void OnResize(const gfx::Rect& bounds);
52 void OnDetermineIfPageSupportsInstant();
53
54 // Sets the searchbox values to their initial value.
55 void Reset();
56
57 string16 value_;
58 bool verbatim_;
59 size_t selection_start_;
60 size_t selection_end_;
61 gfx::Rect rect_;
62
63 DISALLOW_COPY_AND_ASSIGN(SearchBox);
64 };
65
66 #endif // CHROME_RENDERER_SEARCHBOX_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/searchbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698