summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/searchbox_extension.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 20:21:54 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-14 20:21:54 +0000
commit6c2f7320e7767f71385134b184c2e0652600b5c0 (patch)
tree430e3133e61e7f20562926be75d25438210a4b97 /chrome/renderer/searchbox_extension.cc
parent0c6c321fa47d17fdd07bc3a51e615f98c3605277 (diff)
downloadchromium_src-6c2f7320e7767f71385134b184c2e0652600b5c0.zip
chromium_src-6c2f7320e7767f71385134b184c2e0652600b5c0.tar.gz
chromium_src-6c2f7320e7767f71385134b184c2e0652600b5c0.tar.bz2
Move SearchBox code out of RenderView.
Review URL: http://codereview.chromium.org/6510006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/searchbox_extension.cc')
-rw-r--r--chrome/renderer/searchbox_extension.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/chrome/renderer/searchbox_extension.cc b/chrome/renderer/searchbox_extension.cc
index 9be60bd..36fc94c 100644
--- a/chrome/renderer/searchbox_extension.cc
+++ b/chrome/renderer/searchbox_extension.cc
@@ -12,6 +12,7 @@
#include "base/stringprintf.h"
#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/render_view.h"
+#include "chrome/renderer/searchbox.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
@@ -215,8 +216,9 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetValue(
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
return v8::String::New(
- reinterpret_cast<const uint16_t*>(render_view->searchbox().value.c_str()),
- render_view->searchbox().value.length());
+ reinterpret_cast<const uint16_t*>(
+ render_view->searchbox()->value().c_str()),
+ render_view->searchbox()->value().length());
}
// static
@@ -224,7 +226,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetVerbatim(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Boolean::New(render_view->searchbox().verbatim);
+ return v8::Boolean::New(render_view->searchbox()->verbatim());
}
// static
@@ -232,7 +234,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionStart(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().selection_start);
+ return v8::Int32::New(render_view->searchbox()->selection_start());
}
// static
@@ -240,7 +242,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetSelectionEnd(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().selection_end);
+ return v8::Int32::New(render_view->searchbox()->selection_end());
}
// static
@@ -248,7 +250,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetX(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().x);
+ return v8::Int32::New(render_view->searchbox()->rect().x());
}
// static
@@ -256,7 +258,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetY(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().y);
+ return v8::Int32::New(render_view->searchbox()->rect().y());
}
// static
@@ -264,7 +266,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetWidth(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().width);
+ return v8::Int32::New(render_view->searchbox()->rect().width());
}
// static
@@ -272,7 +274,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::GetHeight(
const v8::Arguments& args) {
RenderView* render_view = GetRenderView();
if (!render_view) return v8::Undefined();
- return v8::Int32::New(render_view->searchbox().height);
+ return v8::Int32::New(render_view->searchbox()->rect().height());
}
// Accepts a single argument in form:
@@ -330,7 +332,7 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::SetSuggestions(
}
if (RenderView* render_view = GetRenderView())
- render_view->SetSuggestions(suggestions);
+ render_view->searchbox()->SetSuggestions(suggestions);
return v8::Undefined();
}