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

Side by Side Diff: chrome/browser/instant/instant_page.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: The Great Samarth Merge of 2013 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_page.h" 5 #include "chrome/browser/instant/instant_page.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 18 matching lines...) Expand all
29 } 29 }
30 30
31 void InstantPage::Cancel(const string16& text) { 31 void InstantPage::Cancel(const string16& text) {
32 Send(new ChromeViewMsg_SearchBoxCancel(routing_id(), text)); 32 Send(new ChromeViewMsg_SearchBoxCancel(routing_id(), text));
33 } 33 }
34 34
35 void InstantPage::SetPopupBounds(const gfx::Rect& bounds) { 35 void InstantPage::SetPopupBounds(const gfx::Rect& bounds) {
36 Send(new ChromeViewMsg_SearchBoxPopupResize(routing_id(), bounds)); 36 Send(new ChromeViewMsg_SearchBoxPopupResize(routing_id(), bounds));
37 } 37 }
38 38
39 void InstantPage::SetMarginSize(const int start, const int end) { 39 void InstantPage::SetStartMarginAndWidth(int margin, int width) {
40 Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), start, end)); 40 Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), margin, width));
41 } 41 }
42 42
43 void InstantPage::InitializeFonts() { 43 void InstantPage::InitializeFonts() {
44 const gfx::Font& omnibox_font = 44 const gfx::Font& omnibox_font =
45 ui::ResourceBundle::GetSharedInstance().GetFont( 45 ui::ResourceBundle::GetSharedInstance().GetFont(
46 ui::ResourceBundle::MediumFont); 46 ui::ResourceBundle::MediumFont);
47 string16 omnibox_font_name = UTF8ToUTF16(omnibox_font.GetFontName()); 47 string16 omnibox_font_name = UTF8ToUTF16(omnibox_font.GetFontName());
48 size_t omnibox_font_size = omnibox_font.GetFontSize(); 48 size_t omnibox_font_size = omnibox_font.GetFontSize();
49 Send(new ChromeViewMsg_SearchBoxFontInformation( 49 Send(new ChromeViewMsg_SearchBoxFontInformation(
50 routing_id(), omnibox_font_name, omnibox_font_size)); 50 routing_id(), omnibox_font_name, omnibox_font_size));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 void InstantPage::OnSearchBoxNavigate(int page_id, 230 void InstantPage::OnSearchBoxNavigate(int page_id,
231 const GURL& url, 231 const GURL& url,
232 content::PageTransition transition) { 232 content::PageTransition transition) {
233 if (contents()->IsActiveEntry(page_id)) { 233 if (contents()->IsActiveEntry(page_id)) {
234 OnInstantSupportDetermined(page_id, true); 234 OnInstantSupportDetermined(page_id, true);
235 if (ShouldProcessNavigateToURL()) 235 if (ShouldProcessNavigateToURL())
236 delegate_->NavigateToURL(contents(), url, transition); 236 delegate_->NavigateToURL(contents(), url, transition);
237 } 237 }
238 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698