Chromium Code Reviews| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 web_state()->GetBrowserState())); | 105 web_state()->GetBrowserState())); |
| 106 DCHECK(accept_languages); | 106 DCHECK(accept_languages); |
| 107 return accept_languages; | 107 return accept_languages; |
| 108 } | 108 } |
| 109 | 109 |
| 110 int WebViewTranslateClient::GetInfobarIconID() const { | 110 int WebViewTranslateClient::GetInfobarIconID() const { |
| 111 NOTREACHED(); | 111 NOTREACHED(); |
| 112 return 0; | 112 return 0; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void WebViewTranslateClient::RecordTranslateEvent( | |
| 116 const metrics::TranslateEventProto&) { | |
| 117 // TODO(renjieliu): Implementing gaia-keyed logging. | |
|
Eugene But (OOO till 7-30)
2017/06/12 01:50:00
ditto
renjieliu1
2017/06/13 00:04:59
Done.
| |
| 118 } | |
| 119 | |
| 115 bool WebViewTranslateClient::IsTranslatableURL(const GURL& url) { | 120 bool WebViewTranslateClient::IsTranslatableURL(const GURL& url) { |
| 116 return !url.is_empty() && !url.SchemeIs(url::kFtpScheme); | 121 return !url.is_empty() && !url.SchemeIs(url::kFtpScheme); |
| 117 } | 122 } |
| 118 | 123 |
| 119 void WebViewTranslateClient::ShowReportLanguageDetectionErrorUI( | 124 void WebViewTranslateClient::ShowReportLanguageDetectionErrorUI( |
| 120 const GURL& report_url) { | 125 const GURL& report_url) { |
| 121 NOTREACHED(); | 126 NOTREACHED(); |
| 122 } | 127 } |
| 123 | 128 |
| 124 void WebViewTranslateClient::WebStateDestroyed() { | 129 void WebViewTranslateClient::WebStateDestroyed() { |
| 125 // Translation process can be interrupted. | 130 // Translation process can be interrupted. |
| 126 // Destroying the TranslateManager now guarantees that it never has to deal | 131 // Destroying the TranslateManager now guarantees that it never has to deal |
| 127 // with nullptr WebState. | 132 // with nullptr WebState. |
| 128 translate_manager_.reset(); | 133 translate_manager_.reset(); |
| 129 } | 134 } |
| 130 | 135 |
| 131 } // namespace ios_web_view | 136 } // namespace ios_web_view |
| OLD | NEW |