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

Side by Side Diff: components/translate/ios/browser/language_detection_controller.mm

Issue 2901633002: Replaced NavigationContext::IsErrorPage with NavigationContext::GetError (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | ios/chrome/browser/tabs/tab.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ios/browser/language_detection_controller.h" 5 #include "components/translate/ios/browser/language_detection_controller.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "components/prefs/pref_member.h" 13 #include "components/prefs/pref_member.h"
14 #include "components/translate/core/browser/translate_pref_names.h" 14 #include "components/translate/core/browser/translate_pref_names.h"
15 #include "components/translate/core/language_detection/language_detection_util.h " 15 #include "components/translate/core/language_detection/language_detection_util.h "
16 #import "components/translate/ios/browser/js_language_detection_manager.h" 16 #import "components/translate/ios/browser/js_language_detection_manager.h"
17 #include "components/translate/ios/browser/string_clipping_util.h" 17 #include "components/translate/ios/browser/string_clipping_util.h"
18 #import "ios/web/public/url_scheme_util.h" 18 #import "ios/web/public/url_scheme_util.h"
19 #include "ios/web/public/web_state/navigation_context.h" 19 #import "ios/web/public/web_state/navigation_context.h"
20 #include "ios/web/public/web_state/web_state.h" 20 #include "ios/web/public/web_state/web_state.h"
21 21
22 #if !defined(__has_feature) || !__has_feature(objc_arc) 22 #if !defined(__has_feature) || !__has_feature(objc_arc)
23 #error "This file requires ARC support." 23 #error "This file requires ARC support."
24 #endif 24 #endif
25 25
26 namespace translate { 26 namespace translate {
27 27
28 namespace { 28 namespace {
29 // Name for the UMA metric used to track text extraction time. 29 // Name for the UMA metric used to track text extraction time.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 web::NavigationContext* navigation_context) { 142 web::NavigationContext* navigation_context) {
143 if (navigation_context->IsSameDocument()) 143 if (navigation_context->IsSameDocument())
144 StartLanguageDetection(); 144 StartLanguageDetection();
145 } 145 }
146 146
147 void LanguageDetectionController::WebStateDestroyed() { 147 void LanguageDetectionController::WebStateDestroyed() {
148 web_state()->RemoveScriptCommandCallback(kCommandPrefix); 148 web_state()->RemoveScriptCommandCallback(kCommandPrefix);
149 } 149 }
150 150
151 } // namespace translate 151 } // namespace translate
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/tabs/tab.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698