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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.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: Don't run test on Mac & Linux 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 65bf71e76550eb63560e20a91ed1266c5a440632..cb745307fa252eaa6305c240237af0ab196bfa9b 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -252,7 +252,8 @@ class SearchBoxExtensionWrapper : public v8::Extension {
// region of the search box that overlaps the window.
static v8::Handle<v8::Value> GetY(const v8::Arguments& args);
- // Gets the width of the region of the search box that overlaps the window.
+ // Gets the width of the region of the search box that overlaps the window,
+ // i.e., the width of the omnibox.
static v8::Handle<v8::Value> GetWidth(const v8::Arguments& args);
// Gets the height of the region of the search box that overlaps the window.
@@ -261,14 +262,9 @@ class SearchBoxExtensionWrapper : public v8::Extension {
// Gets Most Visited Items.
static v8::Handle<v8::Value> GetMostVisitedItems(const v8::Arguments& args);
- // Gets the width of the margin from the start-edge of the page to the start
- // of the suggestions dropdown.
+ // Gets the start-edge margin to use with extended Instant.
static v8::Handle<v8::Value> GetStartMargin(const v8::Arguments& args);
- // Gets the width of the margin from the end-edge of the page to the end of
- // the suggestions dropdown.
- static v8::Handle<v8::Value> GetEndMargin(const v8::Arguments& args);
-
// Returns true if the Searchbox itself is oriented right-to-left.
static v8::Handle<v8::Value> GetRightToLeft(const v8::Arguments& args);
@@ -367,8 +363,6 @@ v8::Handle<v8::FunctionTemplate> SearchBoxExtensionWrapper::GetNativeFunction(
return v8::FunctionTemplate::New(GetMostVisitedItems);
if (name->Equals(v8::String::New("GetStartMargin")))
return v8::FunctionTemplate::New(GetStartMargin);
- if (name->Equals(v8::String::New("GetEndMargin")))
- return v8::FunctionTemplate::New(GetEndMargin);
if (name->Equals(v8::String::New("GetRightToLeft")))
return v8::FunctionTemplate::New(GetRightToLeft);
if (name->Equals(v8::String::New("GetAutocompleteResults")))
@@ -482,7 +476,6 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetWidth(
const v8::Arguments& args) {
content::RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
-
return v8::Int32::New(SearchBox::Get(render_view)->GetPopupBounds().width());
}
@@ -504,14 +497,6 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetStartMargin(
}
// static
-v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetEndMargin(
- const v8::Arguments& args) {
- content::RenderView* render_view = GetRenderView();
- if (!render_view) return v8::Undefined();
- return v8::Int32::New(SearchBox::Get(render_view)->GetEndMargin());
-}
-
-// static
v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetRightToLeft(
const v8::Arguments& args) {
return v8::Boolean::New(base::i18n::IsRTL());
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698