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

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

Issue 11091050: InstantExtended: Add js api for custom logo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 (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 #include "chrome/renderer/searchbox/searchbox.h" 5 #include "chrome/renderer/searchbox/searchbox.h"
6 6
7 #include "chrome/common/render_messages.h" 7 #include "chrome/common/render_messages.h"
8 #include "chrome/renderer/searchbox/searchbox_extension.h" 8 #include "chrome/renderer/searchbox/searchbox_extension.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
(...skipping 19 matching lines...) Expand all
30 suggestions[0].behavior == INSTANT_COMPLETE_REPLACE) { 30 suggestions[0].behavior == INSTANT_COMPLETE_REPLACE) {
31 query_ = suggestions[0].text; 31 query_ = suggestions[0].text;
32 verbatim_ = true; 32 verbatim_ = true;
33 selection_start_ = selection_end_ = query_.size(); 33 selection_start_ = selection_end_ = query_.size();
34 } 34 }
35 // Explicitly allow empty vector to be sent to the browser. 35 // Explicitly allow empty vector to be sent to the browser.
36 render_view()->Send(new ChromeViewHostMsg_SetSuggestions( 36 render_view()->Send(new ChromeViewHostMsg_SetSuggestions(
37 render_view()->GetRoutingID(), render_view()->GetPageId(), suggestions)); 37 render_view()->GetRoutingID(), render_view()->GetPageId(), suggestions));
38 } 38 }
39 39
40 void SearchBox::SetHasCustomLogo(bool has_logo)
41 {
42 render_view()->Send(new ChromeViewHostMsg_SetHasCustomLogo(
43 render_view()->GetRoutingID(), render_view()->GetPageId(), has_logo));
44 }
45
40 void SearchBox::SetInstantPreviewHeight(int height, InstantSizeUnits units) { 46 void SearchBox::SetInstantPreviewHeight(int height, InstantSizeUnits units) {
41 render_view()->Send(new ChromeViewHostMsg_SetInstantPreviewHeight( 47 render_view()->Send(new ChromeViewHostMsg_SetInstantPreviewHeight(
42 render_view()->GetRoutingID(), render_view()->GetPageId(), height, 48 render_view()->GetRoutingID(), render_view()->GetPageId(), height,
43 units)); 49 units));
44 } 50 }
45 51
46 gfx::Rect SearchBox::GetRect() { 52 gfx::Rect SearchBox::GetRect() {
47 // Need to adjust for scale. 53 // Need to adjust for scale.
48 if (rect_.IsEmpty()) 54 if (rect_.IsEmpty())
49 return rect_; 55 return rect_;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 201
196 void SearchBox::Reset() { 202 void SearchBox::Reset() {
197 query_.clear(); 203 query_.clear();
198 verbatim_ = false; 204 verbatim_ = false;
199 selection_start_ = selection_end_ = 0; 205 selection_start_ = selection_end_ = 0;
200 results_base_ = 0; 206 results_base_ = 0;
201 rect_ = gfx::Rect(); 207 rect_ = gfx::Rect();
202 autocomplete_results_.clear(); 208 autocomplete_results_.clear();
203 is_focused_ = false; 209 is_focused_ = false;
204 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698