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

Side by Side Diff: ios/web_view/internal/translate/web_view_translate_ranker_factory.cc

Issue 2973173002: Fix crashes when using translate in incognito by overriding some methods. (Closed)
Patch Set: addressed ichikawa comments Created 3 years, 5 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 | « ios/web_view/internal/translate/web_view_translate_ranker_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ios/web_view/internal/translate/web_view_translate_ranker_factory.h" 5 #include "ios/web_view/internal/translate/web_view_translate_ranker_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 web_view_browser_state->GetStatePath()), 46 web_view_browser_state->GetStatePath()),
47 translate::TranslateRankerImpl::GetModelURL(), 47 translate::TranslateRankerImpl::GetModelURL(),
48 nullptr /* ukm::UkmRecorder */); 48 nullptr /* ukm::UkmRecorder */);
49 // WebView has no consumer of translate ranker events, so don't generate them. 49 // WebView has no consumer of translate ranker events, so don't generate them.
50 ranker->EnableLogging(false); 50 ranker->EnableLogging(false);
51 51
52 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. 52 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required.
53 return std::move(ranker); 53 return std::move(ranker);
54 } 54 }
55 55
56 web::BrowserState* WebViewTranslateRankerFactory::GetBrowserStateToUse(
57 web::BrowserState* context) const {
58 // Override to enable this service for off the record browser states.
59 return context;
60 }
61
56 } // namespace ios_web_view 62 } // namespace ios_web_view
OLDNEW
« no previous file with comments | « ios/web_view/internal/translate/web_view_translate_ranker_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698