| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/translate/core/browser/translate_manager.h" | 5 #include "components/translate/core/browser/translate_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 | 600 |
| 601 void TranslateManager::RecordTranslateEvent(int event_type) { | 601 void TranslateManager::RecordTranslateEvent(int event_type) { |
| 602 DCHECK(metrics::TranslateEventProto::EventType_IsValid(event_type)); | 602 DCHECK(metrics::TranslateEventProto::EventType_IsValid(event_type)); |
| 603 translate_event_->set_event_type( | 603 translate_event_->set_event_type( |
| 604 static_cast<metrics::TranslateEventProto::EventType>(event_type)); | 604 static_cast<metrics::TranslateEventProto::EventType>(event_type)); |
| 605 translate_event_->set_event_timestamp_sec( | 605 translate_event_->set_event_timestamp_sec( |
| 606 (base::TimeTicks::Now() - base::TimeTicks()).InSeconds()); | 606 (base::TimeTicks::Now() - base::TimeTicks()).InSeconds()); |
| 607 TranslateRanker::GetInstance()->RecordTranslateEvent(*translate_event_); | 607 TranslateRanker::GetInstance()->RecordTranslateEvent(*translate_event_); |
| 608 } | 608 } |
| 609 | 609 |
| 610 void TranslateManager::RecordDecisionOverride(int event_type) { |
| 611 DCHECK(metrics::TranslateEventProto::EventType_IsValid(event_type)); |
| 612 translate_event_->add_decision_overrides( |
| 613 static_cast<metrics::TranslateEventProto::EventType>(event_type)); |
| 614 } |
| 615 |
| 610 } // namespace translate | 616 } // namespace translate |
| OLD | NEW |