| 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 #import "ios/web_view/internal/translate/web_view_translate_client.h" | 5 #import "ios/web_view/internal/translate/web_view_translate_client.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 web_state()->GetBrowserState())); | 101 web_state()->GetBrowserState())); |
| 102 DCHECK(accept_languages); | 102 DCHECK(accept_languages); |
| 103 return accept_languages; | 103 return accept_languages; |
| 104 } | 104 } |
| 105 | 105 |
| 106 int WebViewTranslateClient::GetInfobarIconID() const { | 106 int WebViewTranslateClient::GetInfobarIconID() const { |
| 107 NOTREACHED(); | 107 NOTREACHED(); |
| 108 return 0; | 108 return 0; |
| 109 } | 109 } |
| 110 | 110 |
| 111 void WebViewTranslateClient::RecordTranslateEvent( |
| 112 const metrics::TranslateEventProto&) { |
| 113 // TODO(renjieliu): Implementing gaia-keyed logging. |
| 114 } |
| 115 |
| 111 bool WebViewTranslateClient::IsTranslatableURL(const GURL& url) { | 116 bool WebViewTranslateClient::IsTranslatableURL(const GURL& url) { |
| 112 return !url.is_empty() && !url.SchemeIs(url::kFtpScheme); | 117 return !url.is_empty() && !url.SchemeIs(url::kFtpScheme); |
| 113 } | 118 } |
| 114 | 119 |
| 115 void WebViewTranslateClient::ShowReportLanguageDetectionErrorUI( | 120 void WebViewTranslateClient::ShowReportLanguageDetectionErrorUI( |
| 116 const GURL& report_url) { | 121 const GURL& report_url) { |
| 117 NOTREACHED(); | 122 NOTREACHED(); |
| 118 } | 123 } |
| 119 | 124 |
| 120 void WebViewTranslateClient::WebStateDestroyed() { | 125 void WebViewTranslateClient::WebStateDestroyed() { |
| 121 // Translation process can be interrupted. | 126 // Translation process can be interrupted. |
| 122 // Destroying the TranslateManager now guarantees that it never has to deal | 127 // Destroying the TranslateManager now guarantees that it never has to deal |
| 123 // with nullptr WebState. | 128 // with nullptr WebState. |
| 124 translate_manager_.reset(); | 129 translate_manager_.reset(); |
| 125 } | 130 } |
| 126 | 131 |
| 127 } // namespace ios_web_view | 132 } // namespace ios_web_view |
| OLD | NEW |