| 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 const v8::FunctionCallbackInfo<v8::Value>& args) { | 964 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 965 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( | 965 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( |
| 966 GURL(chrome::kChromeSearchMostVisitedUrl)); | 966 GURL(chrome::kChromeSearchMostVisitedUrl)); |
| 967 if (!render_view) return; | 967 if (!render_view) return; |
| 968 | 968 |
| 969 if (args.Length() < 1 || !args[0]->IsNumber()) | 969 if (args.Length() < 1 || !args[0]->IsNumber()) |
| 970 return; | 970 return; |
| 971 | 971 |
| 972 DVLOG(1) << render_view << " LogEvent"; | 972 DVLOG(1) << render_view << " LogEvent"; |
| 973 | 973 |
| 974 if (args[0]->Uint32Value() < NTP_NUM_EVENT_TYPES) { | 974 if (args[0]->Uint32Value() <= NTP_EVENT_TYPE_LAST) { |
| 975 NTPLoggingEventType event = | 975 NTPLoggingEventType event = |
| 976 static_cast<NTPLoggingEventType>(args[0]->Uint32Value()); | 976 static_cast<NTPLoggingEventType>(args[0]->Uint32Value()); |
| 977 SearchBox::Get(render_view)->LogEvent(event); | 977 SearchBox::Get(render_view)->LogEvent(event); |
| 978 } | 978 } |
| 979 } | 979 } |
| 980 | 980 |
| 981 // static | 981 // static |
| 982 void SearchBoxExtensionWrapper::LogMostVisitedImpression( | 982 void SearchBoxExtensionWrapper::LogMostVisitedImpression( |
| 983 const v8::FunctionCallbackInfo<v8::Value>& args) { | 983 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 984 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( | 984 content::RenderView* render_view = GetRenderViewWithCheckedOrigin( |
| (...skipping 133 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 |