OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/rlz/rlz.h" | 5 #include "chrome/browser/rlz/rlz.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); | 230 ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); |
231 } | 231 } |
232 } | 232 } |
233 #endif | 233 #endif |
234 | 234 |
235 void RlzLibTest::SimulateOmniboxUsage() { | 235 void RlzLibTest::SimulateOmniboxUsage() { |
236 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be | 236 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be |
237 // true to trigger record of the first search. All other fields are passed in | 237 // true to trigger record of the first search. All other fields are passed in |
238 // with empty or invalid values. | 238 // with empty or invalid values. |
239 AutocompleteResult empty_result; | 239 AutocompleteResult empty_result; |
240 OmniboxLog dummy(base::string16(), false, AutocompleteInput::INVALID, | 240 OmniboxLog dummy(base::string16(), false, metrics::OmniboxInputType::INVALID, |
241 true, 0, false, -1, | 241 true, 0, false, -1, |
242 AutocompleteInput::INVALID_SPEC, | 242 AutocompleteInput::INVALID_SPEC, |
243 base::TimeDelta::FromSeconds(0), 0, | 243 base::TimeDelta::FromSeconds(0), 0, |
244 base::TimeDelta::FromSeconds(0), | 244 base::TimeDelta::FromSeconds(0), |
245 AutocompleteResult()); | 245 AutocompleteResult()); |
246 | 246 |
247 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, | 247 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
248 content::NotificationService::AllSources(), | 248 content::NotificationService::AllSources(), |
249 content::Details<OmniboxLog>(&dummy)); | 249 content::Details<OmniboxLog>(&dummy)); |
250 } | 250 } |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(), | 887 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(), |
888 rlz_lib::FIRST_SEARCH); | 888 rlz_lib::FIRST_SEARCH); |
889 | 889 |
890 ExpectEventRecorded(kOmniboxFirstSearch, true); | 890 ExpectEventRecorded(kOmniboxFirstSearch, true); |
891 | 891 |
892 RLZTracker::ClearRlzState(); | 892 RLZTracker::ClearRlzState(); |
893 | 893 |
894 ExpectEventRecorded(kOmniboxFirstSearch, false); | 894 ExpectEventRecorded(kOmniboxFirstSearch, false); |
895 } | 895 } |
896 #endif // defined(OS_CHROMEOS) | 896 #endif // defined(OS_CHROMEOS) |
OLD | NEW |