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

Side by Side Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Charlie's comments. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/searchbox/searchbox_extension.h" 5 #include "chrome/renderer/searchbox/searchbox_extension.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/common/extensions/extension.h" 11 #include "chrome/common/extensions/extension.h"
12 #include "chrome/renderer/searchbox/searchbox.h" 12 #include "chrome/renderer/searchbox/searchbox.h"
13 #include "content/public/renderer/render_view.h" 13 #include "content/public/renderer/render_view.h"
14 #include "grit/renderer_resources.h" 14 #include "grit/renderer_resources.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
19 #include "ui/base/keycodes/keyboard_codes.h" 19 #include "ui/base/keycodes/keyboard_codes.h"
20 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/base/window_open_disposition.h" 21 #include "ui/base/window_open_disposition.h"
22 #include "v8/include/v8.h" 22 #include "v8/include/v8.h"
23 23
24 namespace { 24 namespace {
25 25
26 const char kCSSBackgroundImageFormat[] = 26 const char kCSSBackgroundImageFormat[] = "-webkit-image-set("
27 "-webkit-image-set(url(chrome://theme/IDR_THEME_BACKGROUND?%s) 1x)"; 27 "url(chrome-search://theme/IDR_THEME_NTP_BACKGROUND?%s) 1x)";
28 28
29 const char kCSSBackgroundColorFormat[] = "rgba(%d,%d,%d,%s)"; 29 const char kCSSBackgroundColorFormat[] = "rgba(%d,%d,%d,%s)";
30 30
31 const char kCSSBackgroundPositionCenter[] = "center"; 31 const char kCSSBackgroundPositionCenter[] = "center";
32 const char kCSSBackgroundPositionLeft[] = "left"; 32 const char kCSSBackgroundPositionLeft[] = "left";
33 const char kCSSBackgroundPositionTop[] = "top"; 33 const char kCSSBackgroundPositionTop[] = "top";
34 const char kCSSBackgroundPositionRight[] = "right"; 34 const char kCSSBackgroundPositionRight[] = "right";
35 const char kCSSBackgroundPositionBottom[] = "bottom"; 35 const char kCSSBackgroundPositionBottom[] = "bottom";
36 36
37 const char kCSSBackgroundRepeatNo[] = "no-repeat"; 37 const char kCSSBackgroundRepeatNo[] = "no-repeat";
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 void SearchBoxExtension::DispatchThemeChange(WebKit::WebFrame* frame) { 1043 void SearchBoxExtension::DispatchThemeChange(WebKit::WebFrame* frame) {
1044 Dispatch(frame, kDispatchThemeChangeEventScript); 1044 Dispatch(frame, kDispatchThemeChangeEventScript);
1045 } 1045 }
1046 1046
1047 // static 1047 // static
1048 void SearchBoxExtension::DispatchMostVisitedChanged( 1048 void SearchBoxExtension::DispatchMostVisitedChanged(
1049 WebKit::WebFrame* frame) { 1049 WebKit::WebFrame* frame) {
1050 Dispatch(frame, kDispatchMostVisitedChangedScript); 1050 Dispatch(frame, kDispatchMostVisitedChangedScript);
1051 } 1051 }
1052 } // namespace extensions_v8 1052 } // namespace extensions_v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698