| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 #endif | 246 #endif |
| 247 | 247 |
| 248 void RlzLibTest::SimulateOmniboxUsage() { | 248 void RlzLibTest::SimulateOmniboxUsage() { |
| 249 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be | 249 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be |
| 250 // true to trigger record of the first search. All other fields are passed in | 250 // true to trigger record of the first search. All other fields are passed in |
| 251 // with empty or invalid values. | 251 // with empty or invalid values. |
| 252 AutocompleteResult empty_result; | 252 AutocompleteResult empty_result; |
| 253 OmniboxLog dummy(base::string16(), false, metrics::OmniboxInputType::INVALID, | 253 OmniboxLog dummy(base::string16(), false, metrics::OmniboxInputType::INVALID, |
| 254 true, 0, false, false, -1, | 254 true, 0, false, -1, |
| 255 metrics::OmniboxEventProto::INVALID_SPEC, | 255 metrics::OmniboxEventProto::INVALID_SPEC, |
| 256 base::TimeDelta::FromSeconds(0), 0, | 256 base::TimeDelta::FromSeconds(0), 0, |
| 257 base::TimeDelta::FromSeconds(0), | 257 base::TimeDelta::FromSeconds(0), |
| 258 AutocompleteResult()); | 258 AutocompleteResult()); |
| 259 | 259 |
| 260 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, | 260 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
| 261 content::NotificationService::AllSources(), | 261 content::NotificationService::AllSources(), |
| 262 content::Details<OmniboxLog>(&dummy)); | 262 content::Details<OmniboxLog>(&dummy)); |
| 263 } | 263 } |
| 264 | 264 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(), | 906 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(), |
| 907 rlz_lib::FIRST_SEARCH); | 907 rlz_lib::FIRST_SEARCH); |
| 908 | 908 |
| 909 ExpectEventRecorded(kOmniboxFirstSearch, true); | 909 ExpectEventRecorded(kOmniboxFirstSearch, true); |
| 910 | 910 |
| 911 RLZTracker::ClearRlzState(); | 911 RLZTracker::ClearRlzState(); |
| 912 | 912 |
| 913 ExpectEventRecorded(kOmniboxFirstSearch, false); | 913 ExpectEventRecorded(kOmniboxFirstSearch, false); |
| 914 } | 914 } |
| 915 #endif // defined(OS_CHROMEOS) | 915 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |