Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: components/translate/core/browser/translate_manager.cc

Issue 2697703004: Allow TranslateRanker to override decisions taken by heuristics. (Closed)
Patch Set: Nit. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698