| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 prefs.GetTranslationIgnoredCount(src_lang)); | 565 prefs.GetTranslationIgnoredCount(src_lang)); |
| 566 translate_event_->set_ranker_response( | 566 translate_event_->set_ranker_response( |
| 567 metrics::TranslateEventProto::NOT_QUERIED); | 567 metrics::TranslateEventProto::NOT_QUERIED); |
| 568 translate_event_->set_event_type(metrics::TranslateEventProto::UNKNOWN); | 568 translate_event_->set_event_type(metrics::TranslateEventProto::UNKNOWN); |
| 569 // TODO(rogerm): Populate the language list. | 569 // TODO(rogerm): Populate the language list. |
| 570 } | 570 } |
| 571 | 571 |
| 572 void TranslateManager::RecordTranslateEvent(int event_type) { | 572 void TranslateManager::RecordTranslateEvent(int event_type) { |
| 573 translate_ranker_->RecordTranslateEvent( | 573 translate_ranker_->RecordTranslateEvent( |
| 574 event_type, translate_driver_->GetVisibleURL(), translate_event_.get()); | 574 event_type, translate_driver_->GetVisibleURL(), translate_event_.get()); |
| 575 translate_client_->RecordTranslateEvent(*translate_event_.get()); |
| 575 } | 576 } |
| 576 | 577 |
| 577 bool TranslateManager::ShouldOverrideDecision(int event_type) { | 578 bool TranslateManager::ShouldOverrideDecision(int event_type) { |
| 578 return translate_ranker_->ShouldOverrideDecision( | 579 return translate_ranker_->ShouldOverrideDecision( |
| 579 event_type, translate_driver_->GetVisibleURL(), translate_event_.get()); | 580 event_type, translate_driver_->GetVisibleURL(), translate_event_.get()); |
| 580 } | 581 } |
| 581 | 582 |
| 582 bool TranslateManager::ShouldSuppressBubbleUI( | 583 bool TranslateManager::ShouldSuppressBubbleUI( |
| 583 bool triggered_from_menu, | 584 bool triggered_from_menu, |
| 584 const std::string& source_language) { | 585 const std::string& source_language) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 601 source_language) && | 602 source_language) && |
| 602 !ShouldOverrideDecision( | 603 !ShouldOverrideDecision( |
| 603 metrics::TranslateEventProto::LANGUAGE_DISABLED_BY_AUTO_BLACKLIST)) { | 604 metrics::TranslateEventProto::LANGUAGE_DISABLED_BY_AUTO_BLACKLIST)) { |
| 604 return true; | 605 return true; |
| 605 } | 606 } |
| 606 | 607 |
| 607 return false; | 608 return false; |
| 608 } | 609 } |
| 609 | 610 |
| 610 } // namespace translate | 611 } // namespace translate |
| OLD | NEW |