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

Side by Side Diff: chrome/renderer/external_extension.cc

Issue 5593001: Expose IsDefaultSearchProvider and SetDefaultSearchProvider by default on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: v1 Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/external_extension.h" 5 #include "chrome/renderer/external_extension.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/render_messages_params.h" 9 #include "chrome/common/render_messages_params.h"
10 #include "chrome/renderer/render_view.h" 10 #include "chrome/renderer/render_view.h"
(...skipping 28 matching lines...) Expand all
39 "};"; 39 "};";
40 40
41 #undef SEARCH_PROVIDER_API_V1 41 #undef SEARCH_PROVIDER_API_V1
42 42
43 const char* const kExternalExtensionName = "v8/External"; 43 const char* const kExternalExtensionName = "v8/External";
44 44
45 // Should the new api's "IsSearchProviderInstalled and InstallSearchProvider 45 // Should the new api's "IsSearchProviderInstalled and InstallSearchProvider
46 // with an extra parameter to indicate if the provider should be the default" 46 // with an extra parameter to indicate if the provider should be the default"
47 // be available? 47 // be available?
48 static bool EnableSearchProviderV2() { 48 static bool EnableSearchProviderV2() {
49 #if defined(OS_WIN)
50 return true;
51 #else
49 return CommandLine::ForCurrentProcess()->HasSwitch( 52 return CommandLine::ForCurrentProcess()->HasSwitch(
50 switches::kEnableSearchProviderApiV2); 53 switches::kEnableSearchProviderApiV2);
54 #endif
51 } 55 }
52 56
53 class ExternalExtensionWrapper : public v8::Extension { 57 class ExternalExtensionWrapper : public v8::Extension {
54 public: 58 public:
55 ExternalExtensionWrapper(); 59 ExternalExtensionWrapper();
56 60
57 // Allows v8's javascript code to call the native functions defined 61 // Allows v8's javascript code to call the native functions defined
58 // in this class for window.external. 62 // in this class for window.external.
59 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( 63 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
60 v8::Handle<v8::String> name); 64 v8::Handle<v8::String> name);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return v8::ThrowException(v8::Exception::Error(v8::String::Empty())); 150 return v8::ThrowException(v8::Exception::Error(v8::String::Empty()));
147 } 151 }
148 return v8::Integer::New(install.state); 152 return v8::Integer::New(install.state);
149 } 153 }
150 154
151 v8::Extension* ExternalExtension::Get() { 155 v8::Extension* ExternalExtension::Get() {
152 return new ExternalExtensionWrapper(); 156 return new ExternalExtensionWrapper();
153 } 157 }
154 158
155 } // namespace extensions_v8 159 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698