| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |