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

Side by Side Diff: components/translate/content/renderer/static_renderer_cld_data_provider.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "static_renderer_cld_data_provider.h"
6
7 #include "content/public/renderer/render_view_observer.h"
8 #include "ipc/ipc_message.h"
9
10 namespace translate {
11 // Implementation of the static factory method from RendererCldDataProvider,
12 // hooking up this specific implementation for all of Chromium.
13 RendererCldDataProvider* CreateRendererCldDataProviderFor(
14 content::RenderViewObserver* render_view_observer) {
15 return new StaticRendererCldDataProvider();
16 }
17
18 StaticRendererCldDataProvider::StaticRendererCldDataProvider() {
19 }
20
21 StaticRendererCldDataProvider::~StaticRendererCldDataProvider() {
22 }
23
24 bool StaticRendererCldDataProvider::OnMessageReceived(
25 const IPC::Message& message) {
26 // No-op: data is statically linked
27 return false;
28 }
29
30 void StaticRendererCldDataProvider::SendCldDataRequest() {
31 // No-op: data is statically linked
32 }
33
34 bool StaticRendererCldDataProvider::IsCldDataAvailable() {
35 // No-op: data is statically linked
36 return true;
37 }
38
39 void StaticRendererCldDataProvider::SetCldAvailableCallback(
40 base::Callback<void(void)> callback) {
41 // Data is statically linked, so just call immediately.
42 callback.Run();
43 }
44
45 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698