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

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

Issue 8468018: chrome: Remove 10 exit time destructors and 2 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 9 years, 1 month 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 | « chrome/renderer/extensions/schema_generated_bindings.cc ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_extension.h" 5 #include "chrome/renderer/searchbox_extension.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 v8::Handle<v8::Value> v = frame->executeScriptAndReturnValue( 414 v8::Handle<v8::Value> v = frame->executeScriptAndReturnValue(
415 WebScriptSource(kSupportsInstantScript)); 415 WebScriptSource(kSupportsInstantScript));
416 bool supports_deprecated_api = !v.IsEmpty() && v->BooleanValue(); 416 bool supports_deprecated_api = !v.IsEmpty() && v->BooleanValue();
417 // TODO(tonyg): Add way of detecting instant support to SearchBox API. 417 // TODO(tonyg): Add way of detecting instant support to SearchBox API.
418 bool supports_searchbox_api = supports_deprecated_api; 418 bool supports_searchbox_api = supports_deprecated_api;
419 419
420 // The deprecated API needs to notify the page of events it may have missed. 420 // The deprecated API needs to notify the page of events it may have missed.
421 // This isn't necessary in the SearchBox API, since the page can query the 421 // This isn't necessary in the SearchBox API, since the page can query the
422 // API at any time. 422 // API at any time.
423 static std::string init_script( 423 CR_DEFINE_STATIC_LOCAL(std::string, init_script,
424 StringPrintf(kInitScript, kSetOmniboxBoundsScript, kUserInputScript)); 424 (StringPrintf(kInitScript, kSetOmniboxBoundsScript, kUserInputScript)));
425 if (supports_deprecated_api) { 425 if (supports_deprecated_api) {
426 frame->executeScript(WebScriptSource(WebString::fromUTF8(init_script))); 426 frame->executeScript(WebScriptSource(WebString::fromUTF8(init_script)));
427 } 427 }
428 428
429 return supports_searchbox_api || supports_deprecated_api; 429 return supports_searchbox_api || supports_deprecated_api;
430 } 430 }
431 431
432 // static 432 // static
433 v8::Extension* SearchBoxExtension::Get() { 433 v8::Extension* SearchBoxExtension::Get() {
434 return new SearchBoxExtensionWrapper(); 434 return new SearchBoxExtensionWrapper();
435 } 435 }
436 436
437 } // namespace extensions_v8 437 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/schema_generated_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698