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

Side by Side Diff: chrome/browser/instant/instant_client.cc

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 #include "chrome/browser/instant/instant_client.h" 5 #include "chrome/browser/instant/instant_client.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/common/render_messages.h" 8 #include "chrome/common/render_messages.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 void InstantClient::Cancel(const string16& text) { 38 void InstantClient::Cancel(const string16& text) {
39 Send(new ChromeViewMsg_SearchBoxCancel(routing_id(), text)); 39 Send(new ChromeViewMsg_SearchBoxCancel(routing_id(), text));
40 } 40 }
41 41
42 void InstantClient::SetPopupBounds(const gfx::Rect& bounds) { 42 void InstantClient::SetPopupBounds(const gfx::Rect& bounds) {
43 Send(new ChromeViewMsg_SearchBoxPopupResize(routing_id(), bounds)); 43 Send(new ChromeViewMsg_SearchBoxPopupResize(routing_id(), bounds));
44 } 44 }
45 45
46 void InstantClient::SetMarginSize(const int start, const int end) { 46 void InstantClient::SetStartMarginAndWidth(int margin, int width) {
47 Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), start, end)); 47 Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), margin, width));
48 } 48 }
49 49
50 void InstantClient::InitializeFonts() { 50 void InstantClient::InitializeFonts() {
51 const gfx::Font& omnibox_font = 51 const gfx::Font& omnibox_font =
52 ui::ResourceBundle::GetSharedInstance().GetFont( 52 ui::ResourceBundle::GetSharedInstance().GetFont(
53 ui::ResourceBundle::MediumFont); 53 ui::ResourceBundle::MediumFont);
54 string16 omnibox_font_name = UTF8ToUTF16(omnibox_font.GetFontName()); 54 string16 omnibox_font_name = UTF8ToUTF16(omnibox_font.GetFontName());
55 size_t omnibox_font_size = omnibox_font.GetFontSize(); 55 size_t omnibox_font_size = omnibox_font.GetFontSize();
56 Send(new ChromeViewMsg_SearchBoxFontInformation( 56 Send(new ChromeViewMsg_SearchBoxFontInformation(
57 routing_id(), omnibox_font_name, omnibox_font_size)); 57 routing_id(), omnibox_font_name, omnibox_font_size));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (web_contents()->IsActiveEntry(page_id)) 170 if (web_contents()->IsActiveEntry(page_id))
171 delegate_->StopCapturingKeyStrokes(); 171 delegate_->StopCapturingKeyStrokes();
172 } 172 }
173 173
174 void InstantClient::SearchBoxNavigate(int page_id, 174 void InstantClient::SearchBoxNavigate(int page_id,
175 const GURL& url, 175 const GURL& url,
176 content::PageTransition transition) { 176 content::PageTransition transition) {
177 if (web_contents()->IsActiveEntry(page_id)) 177 if (web_contents()->IsActiveEntry(page_id))
178 delegate_->NavigateToURL(url, transition); 178 delegate_->NavigateToURL(url, transition);
179 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698