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

Unified Diff: chrome/renderer/searchbox/searchbox.cc

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another rebase Created 7 years, 9 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.h ('k') | chrome/renderer/searchbox/searchbox_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index 6348ae6ad87d0c3843cf6f6db612e17aaf36fceb..59163ee0739287a2d7528451536f5c4592cf0d3d 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -6,8 +6,10 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/url_constants.h"
#include "chrome/renderer/searchbox/searchbox_extension.h"
#include "content/public/renderer/render_view.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
namespace {
@@ -157,6 +159,9 @@ bool SearchBox::OnMessageReceived(const IPC::Message& message) {
OnThemeChanged)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxFontInformation,
OnFontInformationReceived)
+ IPC_MESSAGE_HANDLER(
+ ChromeViewMsg_SearchBoxGrantChromeSearchAccessFromOrigin,
+ OnGrantChromeSearchAccessFromOrigin)
IPC_MESSAGE_HANDLER(ChromeViewMsg_InstantMostVisitedItemsChanged,
OnMostVisitedChanged)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -291,6 +296,31 @@ void SearchBox::OnThemeChanged(const ThemeBackgroundInfo& theme_info) {
}
}
+void SearchBox::OnFontInformationReceived(const string16& omnibox_font,
+ size_t omnibox_font_size) {
+ omnibox_font_ = omnibox_font;
+ omnibox_font_size_ = omnibox_font_size;
+}
+
+void SearchBox::OnGrantChromeSearchAccessFromOrigin(const GURL& origin_url) {
+ string16 chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme));
+ WebKit::WebSecurityPolicy::addOriginAccessWhitelistEntry(
+ origin_url,
+ chrome_search_scheme,
+ ASCIIToUTF16(chrome::kChromeUIFaviconHost),
+ false);
+ WebKit::WebSecurityPolicy::addOriginAccessWhitelistEntry(
+ origin_url,
+ chrome_search_scheme,
+ ASCIIToUTF16(chrome::kChromeUIThemeHost),
+ false);
+ WebKit::WebSecurityPolicy::addOriginAccessWhitelistEntry(
+ origin_url,
+ chrome_search_scheme,
+ ASCIIToUTF16(chrome::kChromeUIThumbnailHost),
+ false);
+}
+
double SearchBox::GetZoom() const {
WebKit::WebView* web_view = render_view()->GetWebView();
if (web_view) {
@@ -301,12 +331,6 @@ double SearchBox::GetZoom() const {
return 1.0;
}
-void SearchBox::OnFontInformationReceived(const string16& omnibox_font,
- size_t omnibox_font_size) {
- omnibox_font_ = omnibox_font;
- omnibox_font_size_ = omnibox_font_size;
-}
-
void SearchBox::Reset() {
query_.clear();
verbatim_ = false;
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698