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" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/common/autocomplete_match_type.h" | 13 #include "chrome/common/autocomplete_match_type.h" |
14 #include "chrome/common/instant_types.h" | 14 #include "chrome/common/instant_types.h" |
15 #include "chrome/common/ntp_logging_events.h" | 15 #include "chrome/common/ntp_logging_events.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "chrome/renderer/searchbox/searchbox.h" | 17 #include "chrome/renderer/searchbox/searchbox.h" |
| 18 #include "content/public/common/url_constants.h" |
18 #include "content/public/renderer/render_view.h" | 19 #include "content/public/renderer/render_view.h" |
19 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
20 #include "grit/renderer_resources.h" | 21 #include "grit/renderer_resources.h" |
21 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 22 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
22 #include "third_party/WebKit/public/web/WebDocument.h" | 23 #include "third_party/WebKit/public/web/WebDocument.h" |
23 #include "third_party/WebKit/public/web/WebFrame.h" | 24 #include "third_party/WebKit/public/web/WebFrame.h" |
24 #include "third_party/WebKit/public/web/WebScriptSource.h" | 25 #include "third_party/WebKit/public/web/WebScriptSource.h" |
25 #include "third_party/WebKit/public/web/WebView.h" | 26 #include "third_party/WebKit/public/web/WebView.h" |
26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
27 #include "ui/base/window_open_disposition.h" | 28 #include "ui/base/window_open_disposition.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 static void DeleteMostVisitedItem( | 356 static void DeleteMostVisitedItem( |
356 const v8::FunctionCallbackInfo<v8::Value>& args); | 357 const v8::FunctionCallbackInfo<v8::Value>& args); |
357 | 358 |
358 // Focuses the omnibox. | 359 // Focuses the omnibox. |
359 static void Focus(const v8::FunctionCallbackInfo<v8::Value>& args); | 360 static void Focus(const v8::FunctionCallbackInfo<v8::Value>& args); |
360 | 361 |
361 // Gets whether or not the app launcher is enabled. | 362 // Gets whether or not the app launcher is enabled. |
362 static void GetAppLauncherEnabled( | 363 static void GetAppLauncherEnabled( |
363 const v8::FunctionCallbackInfo<v8::Value>& args); | 364 const v8::FunctionCallbackInfo<v8::Value>& args); |
364 | 365 |
| 366 // Gets the desired navigation behavior from a click event. |
| 367 static void GetDispositionFromClick( |
| 368 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 369 |
365 // Gets Most Visited Items. | 370 // Gets Most Visited Items. |
366 static void GetMostVisitedItems( | 371 static void GetMostVisitedItems( |
367 const v8::FunctionCallbackInfo<v8::Value>& args); | 372 const v8::FunctionCallbackInfo<v8::Value>& args); |
368 | 373 |
369 // Gets the raw data for a most visited item including its raw URL. | 374 // Gets the raw data for a most visited item including its raw URL. |
370 // GetRenderViewWithCheckedOrigin() enforces that only code in the origin | 375 // GetRenderViewWithCheckedOrigin() enforces that only code in the origin |
371 // chrome-search://most-visited can call this function. | 376 // chrome-search://most-visited can call this function. |
372 static void GetMostVisitedItemData( | 377 static void GetMostVisitedItemData( |
373 const v8::FunctionCallbackInfo<v8::Value>& args); | 378 const v8::FunctionCallbackInfo<v8::Value>& args); |
374 | 379 |
(...skipping 23 matching lines...) Expand all Loading... |
398 const v8::FunctionCallbackInfo<v8::Value>& args); | 403 const v8::FunctionCallbackInfo<v8::Value>& args); |
399 | 404 |
400 // Gets whether the browser is capturing key strokes. | 405 // Gets whether the browser is capturing key strokes. |
401 static void IsKeyCaptureEnabled( | 406 static void IsKeyCaptureEnabled( |
402 const v8::FunctionCallbackInfo<v8::Value>& args); | 407 const v8::FunctionCallbackInfo<v8::Value>& args); |
403 | 408 |
404 // Logs information from the iframes/titles on the NTP. | 409 // Logs information from the iframes/titles on the NTP. |
405 static void LogEvent(const v8::FunctionCallbackInfo<v8::Value>& args); | 410 static void LogEvent(const v8::FunctionCallbackInfo<v8::Value>& args); |
406 | 411 |
407 // Logs an impression on one of the Most Visited tile on the NTP. | 412 // Logs an impression on one of the Most Visited tile on the NTP. |
408 static void LogImpression(const v8::FunctionCallbackInfo<v8::Value>& args); | 413 static void LogMostVisitedImpression( |
| 414 const v8::FunctionCallbackInfo<v8::Value>& args); |
| 415 |
| 416 // Logs a navigation on one of the Most Visited tile on the NTP. |
| 417 static void LogMostVisitedNavigation( |
| 418 const v8::FunctionCallbackInfo<v8::Value>& args); |
409 | 419 |
410 // Navigates the window to a URL represented by either a URL string or a | 420 // Navigates the window to a URL represented by either a URL string or a |
411 // restricted ID. | 421 // restricted ID. |
412 static void NavigateContentWindow( | 422 static void NavigateContentWindow( |
413 const v8::FunctionCallbackInfo<v8::Value>& args); | 423 const v8::FunctionCallbackInfo<v8::Value>& args); |
414 | 424 |
415 // Pastes provided value or clipboard's content into the omnibox. | 425 // Pastes provided value or clipboard's content into the omnibox. |
416 static void Paste(const v8::FunctionCallbackInfo<v8::Value>& args); | 426 static void Paste(const v8::FunctionCallbackInfo<v8::Value>& args); |
417 | 427 |
418 // Indicates whether the page supports voice search. | 428 // Indicates whether the page supports voice search. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 v8::Handle<v8::String> name) { | 544 v8::Handle<v8::String> name) { |
535 if (name->Equals( | 545 if (name->Equals( |
536 v8::String::NewFromUtf8(isolate, "CheckIsUserSignedInToChromeAs"))) | 546 v8::String::NewFromUtf8(isolate, "CheckIsUserSignedInToChromeAs"))) |
537 return v8::FunctionTemplate::New(isolate, CheckIsUserSignedInToChromeAs); | 547 return v8::FunctionTemplate::New(isolate, CheckIsUserSignedInToChromeAs); |
538 if (name->Equals(v8::String::NewFromUtf8(isolate, "DeleteMostVisitedItem"))) | 548 if (name->Equals(v8::String::NewFromUtf8(isolate, "DeleteMostVisitedItem"))) |
539 return v8::FunctionTemplate::New(isolate, DeleteMostVisitedItem); | 549 return v8::FunctionTemplate::New(isolate, DeleteMostVisitedItem); |
540 if (name->Equals(v8::String::NewFromUtf8(isolate, "Focus"))) | 550 if (name->Equals(v8::String::NewFromUtf8(isolate, "Focus"))) |
541 return v8::FunctionTemplate::New(isolate, Focus); | 551 return v8::FunctionTemplate::New(isolate, Focus); |
542 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetAppLauncherEnabled"))) | 552 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetAppLauncherEnabled"))) |
543 return v8::FunctionTemplate::New(isolate, GetAppLauncherEnabled); | 553 return v8::FunctionTemplate::New(isolate, GetAppLauncherEnabled); |
| 554 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetDispositionFromClick"))) |
| 555 return v8::FunctionTemplate::New(isolate, GetDispositionFromClick); |
544 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItems"))) | 556 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItems"))) |
545 return v8::FunctionTemplate::New(isolate, GetMostVisitedItems); | 557 return v8::FunctionTemplate::New(isolate, GetMostVisitedItems); |
546 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItemData"))) | 558 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItemData"))) |
547 return v8::FunctionTemplate::New(isolate, GetMostVisitedItemData); | 559 return v8::FunctionTemplate::New(isolate, GetMostVisitedItemData); |
548 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetQuery"))) | 560 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetQuery"))) |
549 return v8::FunctionTemplate::New(isolate, GetQuery); | 561 return v8::FunctionTemplate::New(isolate, GetQuery); |
550 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetRightToLeft"))) | 562 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetRightToLeft"))) |
551 return v8::FunctionTemplate::New(isolate, GetRightToLeft); | 563 return v8::FunctionTemplate::New(isolate, GetRightToLeft); |
552 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetStartMargin"))) | 564 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetStartMargin"))) |
553 return v8::FunctionTemplate::New(isolate, GetStartMargin); | 565 return v8::FunctionTemplate::New(isolate, GetStartMargin); |
554 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetSuggestionToPrefetch"))) | 566 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetSuggestionToPrefetch"))) |
555 return v8::FunctionTemplate::New(isolate, GetSuggestionToPrefetch); | 567 return v8::FunctionTemplate::New(isolate, GetSuggestionToPrefetch); |
556 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetThemeBackgroundInfo"))) | 568 if (name->Equals(v8::String::NewFromUtf8(isolate, "GetThemeBackgroundInfo"))) |
557 return v8::FunctionTemplate::New(isolate, GetThemeBackgroundInfo); | 569 return v8::FunctionTemplate::New(isolate, GetThemeBackgroundInfo); |
558 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsFocused"))) | 570 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsFocused"))) |
559 return v8::FunctionTemplate::New(isolate, IsFocused); | 571 return v8::FunctionTemplate::New(isolate, IsFocused); |
560 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsInputInProgress"))) | 572 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsInputInProgress"))) |
561 return v8::FunctionTemplate::New(isolate, IsInputInProgress); | 573 return v8::FunctionTemplate::New(isolate, IsInputInProgress); |
562 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsKeyCaptureEnabled"))) | 574 if (name->Equals(v8::String::NewFromUtf8(isolate, "IsKeyCaptureEnabled"))) |
563 return v8::FunctionTemplate::New(isolate, IsKeyCaptureEnabled); | 575 return v8::FunctionTemplate::New(isolate, IsKeyCaptureEnabled); |
564 if (name->Equals(v8::String::NewFromUtf8(isolate, "LogEvent"))) | 576 if (name->Equals(v8::String::NewFromUtf8(isolate, "LogEvent"))) |
565 return v8::FunctionTemplate::New(isolate, LogEvent); | 577 return v8::FunctionTemplate::New(isolate, LogEvent); |
566 if (name->Equals(v8::String::NewFromUtf8(isolate, "LogImpression"))) | 578 if (name->Equals( |
567 return v8::FunctionTemplate::New(isolate, LogImpression); | 579 v8::String::NewFromUtf8(isolate, "LogMostVisitedImpression"))) { |
| 580 return v8::FunctionTemplate::New(isolate, LogMostVisitedImpression); |
| 581 } |
| 582 if (name->Equals( |
| 583 v8::String::NewFromUtf8(isolate, "LogMostVisitedNavigation"))) { |
| 584 return v8::FunctionTemplate::New(isolate, LogMostVisitedNavigation); |
| 585 } |
568 if (name->Equals(v8::String::NewFromUtf8(isolate, "NavigateContentWindow"))) | 586 if (name->Equals(v8::String::NewFromUtf8(isolate, "NavigateContentWindow"))) |
569 return v8::FunctionTemplate::New(isolate, NavigateContentWindow); | 587 return v8::FunctionTemplate::New(isolate, NavigateContentWindow); |
570 if (name->Equals(v8::String::NewFromUtf8(isolate, "Paste"))) | 588 if (name->Equals(v8::String::NewFromUtf8(isolate, "Paste"))) |
571 return v8::FunctionTemplate::New(isolate, Paste); | 589 return v8::FunctionTemplate::New(isolate, Paste); |
572 if (name->Equals(v8::String::NewFromUtf8(isolate, "SetVoiceSearchSupported"))) | 590 if (name->Equals(v8::String::NewFromUtf8(isolate, "SetVoiceSearchSupported"))) |
573 return v8::FunctionTemplate::New(isolate, SetVoiceSearchSupported); | 591 return v8::FunctionTemplate::New(isolate, SetVoiceSearchSupported); |
574 if (name->Equals( | 592 if (name->Equals( |
575 v8::String::NewFromUtf8(isolate, "StartCapturingKeyStrokes"))) | 593 v8::String::NewFromUtf8(isolate, "StartCapturingKeyStrokes"))) |
576 return v8::FunctionTemplate::New(isolate, StartCapturingKeyStrokes); | 594 return v8::FunctionTemplate::New(isolate, StartCapturingKeyStrokes); |
577 if (name->Equals(v8::String::NewFromUtf8(isolate, "StopCapturingKeyStrokes"))) | 595 if (name->Equals(v8::String::NewFromUtf8(isolate, "StopCapturingKeyStrokes"))) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 void SearchBoxExtensionWrapper::GetAppLauncherEnabled( | 652 void SearchBoxExtensionWrapper::GetAppLauncherEnabled( |
635 const v8::FunctionCallbackInfo<v8::Value>& args) { | 653 const v8::FunctionCallbackInfo<v8::Value>& args) { |
636 content::RenderView* render_view = GetRenderView(); | 654 content::RenderView* render_view = GetRenderView(); |
637 if (!render_view) return; | 655 if (!render_view) return; |
638 | 656 |
639 args.GetReturnValue().Set( | 657 args.GetReturnValue().Set( |
640 SearchBox::Get(render_view)->app_launcher_enabled()); | 658 SearchBox::Get(render_view)->app_launcher_enabled()); |
641 } | 659 } |
642 | 660 |
643 // static | 661 // static |
| 662 void SearchBoxExtensionWrapper::GetDispositionFromClick( |
| 663 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 664 content::RenderView* render_view = GetRenderView(); |
| 665 if (!render_view || args.Length() != 5) return; |
| 666 |
| 667 bool middle_button = args[0]->BooleanValue(); |
| 668 bool alt_key = args[1]->BooleanValue(); |
| 669 bool ctrl_key = args[2]->BooleanValue(); |
| 670 bool meta_key = args[3]->BooleanValue(); |
| 671 bool shift_key = args[4]->BooleanValue(); |
| 672 |
| 673 WindowOpenDisposition disposition = ui::DispositionFromClick(middle_button, |
| 674 alt_key, |
| 675 ctrl_key, |
| 676 meta_key, |
| 677 shift_key); |
| 678 v8::Isolate* isolate = args.GetIsolate(); |
| 679 args.GetReturnValue().Set(v8::Int32::New(isolate, disposition)); |
| 680 } |
| 681 |
| 682 // static |
644 void SearchBoxExtensionWrapper::GetMostVisitedItems( | 683 void SearchBoxExtensionWrapper::GetMostVisitedItems( |
645 const v8::FunctionCallbackInfo<v8::Value>& args) { | 684 const v8::FunctionCallbackInfo<v8::Value>& args) { |
646 content::RenderView* render_view = GetRenderView(); | 685 content::RenderView* render_view = GetRenderView(); |
647 if (!render_view) | 686 if (!render_view) |
648 return; | 687 return; |
649 DVLOG(1) << render_view << " GetMostVisitedItems"; | 688 DVLOG(1) << render_view << " GetMostVisitedItems"; |
650 | 689 |
651 const SearchBox* search_box = SearchBox::Get(render_view); | 690 const SearchBox* search_box = SearchBox::Get(render_view); |
652 | 691 |
653 std::vector<InstantMostVisitedItemIDPair> instant_mv_items; | 692 std::vector<InstantMostVisitedItemIDPair> instant_mv_items; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 DVLOG(1) << render_view << " LogEvent"; | 971 DVLOG(1) << render_view << " LogEvent"; |
933 | 972 |
934 if (args[0]->Uint32Value() < NTP_NUM_EVENT_TYPES) { | 973 if (args[0]->Uint32Value() < NTP_NUM_EVENT_TYPES) { |
935 NTPLoggingEventType event = | 974 NTPLoggingEventType event = |
936 static_cast<NTPLoggingEventType>(args[0]->Uint32Value()); | 975 static_cast<NTPLoggingEventType>(args[0]->Uint32Value()); |
937 SearchBox::Get(render_view)->LogEvent(event); | 976 SearchBox::Get(render_view)->LogEvent(event); |
938 } | 977 } |
939 } | 978 } |
940 | 979 |
941 // static | 980 // static |
942 void SearchBoxExtensionWrapper::LogImpression( | 981 void SearchBoxExtensionWrapper::LogMostVisitedImpression( |
943 const v8::FunctionCallbackInfo<v8::Value>& args) { | 982 const v8::FunctionCallbackInfo<v8::Value>& args) { |
944 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( | 983 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( |
945 GURL(chrome::kChromeSearchMostVisitedUrl)); | 984 GURL(chrome::kChromeSearchMostVisitedUrl)); |
| 985 if (!render_view) return; |
| 986 |
| 987 if (args.Length() < 2 || !args[0]->IsNumber() || args[1]->IsUndefined()) |
| 988 return; |
| 989 |
| 990 DVLOG(1) << render_view << " LogMostVisitedImpression"; |
| 991 |
| 992 SearchBox::Get(render_view)->LogMostVisitedImpression( |
| 993 args[0]->IntegerValue(), V8ValueToUTF16(args[1])); |
| 994 } |
| 995 |
| 996 // static |
| 997 void SearchBoxExtensionWrapper::LogMostVisitedNavigation( |
| 998 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 999 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( |
| 1000 GURL(chrome::kChromeSearchMostVisitedUrl)); |
946 if (!render_view) return; | 1001 if (!render_view) return; |
947 | 1002 |
948 if (args.Length() < 2 || !args[0]->IsNumber() || args[1]->IsUndefined()) | 1003 if (args.Length() < 2 || !args[0]->IsNumber() || args[1]->IsUndefined()) |
949 return; | 1004 return; |
950 | 1005 |
951 DVLOG(1) << render_view << " LogImpression"; | 1006 DVLOG(1) << render_view << " LogMostVisitedNavigation"; |
952 | 1007 |
953 SearchBox::Get(render_view)->LogImpression(args[0]->IntegerValue(), | 1008 SearchBox::Get(render_view)->LogMostVisitedNavigation( |
954 V8ValueToUTF16(args[1])); | 1009 args[0]->IntegerValue(), V8ValueToUTF16(args[1])); |
955 } | 1010 } |
956 | 1011 |
957 // static | 1012 // static |
958 void SearchBoxExtensionWrapper::NavigateContentWindow( | 1013 void SearchBoxExtensionWrapper::NavigateContentWindow( |
959 const v8::FunctionCallbackInfo<v8::Value>& args) { | 1014 const v8::FunctionCallbackInfo<v8::Value>& args) { |
960 content::RenderView* render_view = GetRenderView(); | 1015 content::RenderView* render_view = GetRenderView(); |
961 if (!render_view || !args.Length()) return; | 1016 if (!render_view || !args.Length()) return; |
962 | 1017 |
963 GURL destination_url; | 1018 GURL destination_url; |
964 bool is_most_visited_item_url = false; | 1019 bool is_most_visited_item_url = false; |
965 // Check if the url is a rid | 1020 // Check if the url is a rid |
966 if (args[0]->IsNumber()) { | 1021 if (args[0]->IsNumber()) { |
967 InstantMostVisitedItem item; | 1022 InstantMostVisitedItem item; |
968 if (SearchBox::Get(render_view)->GetMostVisitedItemWithID( | 1023 if (SearchBox::Get(render_view)->GetMostVisitedItemWithID( |
969 args[0]->IntegerValue(), &item)) { | 1024 args[0]->IntegerValue(), &item)) { |
970 destination_url = item.url; | 1025 destination_url = item.url; |
971 is_most_visited_item_url = true; | 1026 is_most_visited_item_url = true; |
972 } | 1027 } |
973 } else { | 1028 } else { |
974 // Resolve the URL | 1029 // Resolve the URL |
975 const base::string16& possibly_relative_url = V8ValueToUTF16(args[0]); | 1030 const base::string16& possibly_relative_url = V8ValueToUTF16(args[0]); |
976 GURL current_url = GetCurrentURL(render_view); | 1031 GURL current_url = GetCurrentURL(render_view); |
977 destination_url = internal::ResolveURL(current_url, possibly_relative_url); | 1032 destination_url = internal::ResolveURL(current_url, possibly_relative_url); |
978 } | 1033 } |
979 | 1034 |
980 DVLOG(1) << render_view << " NavigateContentWindow: " << destination_url; | 1035 DVLOG(1) << render_view << " NavigateContentWindow: " << destination_url; |
981 | 1036 |
982 // Navigate the main frame. | 1037 // Navigate the main frame. |
983 if (destination_url.is_valid()) { | 1038 if (destination_url.is_valid() && |
| 1039 !destination_url.SchemeIs(content::kJavaScriptScheme)) { |
984 WindowOpenDisposition disposition = CURRENT_TAB; | 1040 WindowOpenDisposition disposition = CURRENT_TAB; |
985 if (args[1]->Uint32Value() == 2) | 1041 if (args[1]->IsNumber()) { |
986 disposition = NEW_BACKGROUND_TAB; | 1042 disposition = (WindowOpenDisposition) args[1]->Uint32Value(); |
| 1043 } |
987 SearchBox::Get(render_view)->NavigateToURL(destination_url, disposition, | 1044 SearchBox::Get(render_view)->NavigateToURL(destination_url, disposition, |
988 is_most_visited_item_url); | 1045 is_most_visited_item_url); |
989 } | 1046 } |
990 } | 1047 } |
991 | 1048 |
992 // static | 1049 // static |
993 void SearchBoxExtensionWrapper::Paste( | 1050 void SearchBoxExtensionWrapper::Paste( |
994 const v8::FunctionCallbackInfo<v8::Value>& args) { | 1051 const v8::FunctionCallbackInfo<v8::Value>& args) { |
995 content::RenderView* render_view = GetRenderView(); | 1052 content::RenderView* render_view = GetRenderView(); |
996 if (!render_view) return; | 1053 if (!render_view) return; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 if (!render_view) return; | 1117 if (!render_view) return; |
1061 | 1118 |
1062 bool display_instant_results = | 1119 bool display_instant_results = |
1063 SearchBox::Get(render_view)->display_instant_results(); | 1120 SearchBox::Get(render_view)->display_instant_results(); |
1064 DVLOG(1) << render_view << " GetDisplayInstantResults" << | 1121 DVLOG(1) << render_view << " GetDisplayInstantResults" << |
1065 display_instant_results; | 1122 display_instant_results; |
1066 args.GetReturnValue().Set(display_instant_results); | 1123 args.GetReturnValue().Set(display_instant_results); |
1067 } | 1124 } |
1068 | 1125 |
1069 } // namespace extensions_v8 | 1126 } // namespace extensions_v8 |
OLD | NEW |