blob: fa7ea9e4432cbbec670a0323584ac55dcc8ea50f [file] [log] [blame]
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/strings/string16.h"
namespace v8 {
class Extension;
namespace blink {
class WebFrame;
namespace extensions_v8 {
// Reference implementation of the SearchBox API as described in:
class SearchBoxExtension {
// Returns the v8::Extension object handling searchbox bindings. Returns null
// if match-preview is not enabled. Caller takes ownership of returned object.
static v8::Extension* Get();
// Returns true if a page supports Instant, that is, if it has bound an
// onsubmit() handler.
static bool PageSupportsInstant(blink::WebFrame* frame);
// Helpers to dispatch Javascript events.
static void DispatchChromeIdentityCheckResult(blink::WebFrame* frame,
const base::string16& identity,
bool identity_match);
static void DispatchFocusChange(blink::WebFrame* frame);
static void DispatchHistorySyncCheckResult(blink::WebFrame* frame,
bool sync_history);
static void DispatchInputCancel(blink::WebFrame* frame);
static void DispatchInputStart(blink::WebFrame* frame);
static void DispatchKeyCaptureChange(blink::WebFrame* frame);
static void DispatchMarginChange(blink::WebFrame* frame);
static void DispatchMostVisitedChanged(blink::WebFrame* frame);
static void DispatchSubmit(blink::WebFrame* frame);
static void DispatchSuggestionChange(blink::WebFrame* frame);
static void DispatchThemeChange(blink::WebFrame* frame);
static void DispatchToggleVoiceSearch(blink::WebFrame* frame);
} // namespace extensions_v8