OLD | NEW |
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/json/string_escape.h" | 8 #include "base/json/string_escape.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // ---------------------------------------------------------------------------- | 336 // ---------------------------------------------------------------------------- |
337 | 337 |
338 class SearchBoxExtensionWrapper : public v8::Extension { | 338 class SearchBoxExtensionWrapper : public v8::Extension { |
339 public: | 339 public: |
340 explicit SearchBoxExtensionWrapper(const base::StringPiece& code); | 340 explicit SearchBoxExtensionWrapper(const base::StringPiece& code); |
341 | 341 |
342 // Allows v8's javascript code to call the native functions defined | 342 // Allows v8's javascript code to call the native functions defined |
343 // in this class for window.chrome. | 343 // in this class for window.chrome. |
344 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( | 344 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
345 v8::Isolate*, | 345 v8::Isolate*, |
346 v8::Handle<v8::String> name) OVERRIDE; | 346 v8::Handle<v8::String> name) override; |
347 | 347 |
348 // Helper function to find the RenderView. May return NULL. | 348 // Helper function to find the RenderView. May return NULL. |
349 static content::RenderView* GetRenderView(); | 349 static content::RenderView* GetRenderView(); |
350 | 350 |
351 // Sends a Chrome identity check to the browser. | 351 // Sends a Chrome identity check to the browser. |
352 static void CheckIsUserSignedInToChromeAs( | 352 static void CheckIsUserSignedInToChromeAs( |
353 const v8::FunctionCallbackInfo<v8::Value>& args); | 353 const v8::FunctionCallbackInfo<v8::Value>& args); |
354 | 354 |
355 // Deletes a Most Visited item. | 355 // Deletes a Most Visited item. |
356 static void DeleteMostVisitedItem( | 356 static void DeleteMostVisitedItem( |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 if (!render_view) return; | 1118 if (!render_view) return; |
1119 | 1119 |
1120 bool display_instant_results = | 1120 bool display_instant_results = |
1121 SearchBox::Get(render_view)->display_instant_results(); | 1121 SearchBox::Get(render_view)->display_instant_results(); |
1122 DVLOG(1) << render_view << " GetDisplayInstantResults" << | 1122 DVLOG(1) << render_view << " GetDisplayInstantResults" << |
1123 display_instant_results; | 1123 display_instant_results; |
1124 args.GetReturnValue().Set(display_instant_results); | 1124 args.GetReturnValue().Set(display_instant_results); |
1125 } | 1125 } |
1126 | 1126 |
1127 } // namespace extensions_v8 | 1127 } // namespace extensions_v8 |
OLD | NEW |