| 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 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATA_PROVIDER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATA_PROVIDER_H_ |
| 6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATA_PROVIDER_H_ | 6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATA_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "ipc/ipc_listener.h" | 9 #include "ipc/ipc_listener.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // The implementation must be paired with a browser-side implementation of | 22 // The implementation must be paired with a browser-side implementation of |
| 23 // the BrowserCldDataProvider class: | 23 // the BrowserCldDataProvider class: |
| 24 // | 24 // |
| 25 // components/translate/content/browser/browser_cld_data_provider.h | 25 // components/translate/content/browser/browser_cld_data_provider.h |
| 26 // | 26 // |
| 27 // ... and the glue between them is typically a pair of request/response IPC | 27 // ... and the glue between them is typically a pair of request/response IPC |
| 28 // messages using the CldDataProviderMsgStart IPCMessageStart enumerated | 28 // messages using the CldDataProviderMsgStart IPCMessageStart enumerated |
| 29 // constant from ipc_message_start.h | 29 // constant from ipc_message_start.h |
| 30 class RendererCldDataProvider : public IPC::Listener { | 30 class RendererCldDataProvider : public IPC::Listener { |
| 31 public: | 31 public: |
| 32 virtual ~RendererCldDataProvider() {} | 32 ~RendererCldDataProvider() override {} |
| 33 | 33 |
| 34 // (Inherited from IPC::Listener) | 34 // (Inherited from IPC::Listener) |
| 35 // If the specified message is a response for CLD data, attempts to | 35 // If the specified message is a response for CLD data, attempts to |
| 36 // initialize CLD2 and returns true in all cases. If initialization is | 36 // initialize CLD2 and returns true in all cases. If initialization is |
| 37 // successful and a callback has been configured via | 37 // successful and a callback has been configured via |
| 38 // SetCldAvailableCallback(...), that callback is invoked from the message | 38 // SetCldAvailableCallback(...), that callback is invoked from the message |
| 39 // loop thread. | 39 // loop thread. |
| 40 // This method is defined as virtual in order to force the implementation to | 40 // This method is defined as virtual in order to force the implementation to |
| 41 // define the specific IPC message(s) that it handles. | 41 // define the specific IPC message(s) that it handles. |
| 42 virtual bool OnMessageReceived(const IPC::Message&) = 0; | 42 virtual bool OnMessageReceived(const IPC::Message&) = 0; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // Static factory function defined by the implementation that produces a new | 65 // Static factory function defined by the implementation that produces a new |
| 66 // provider for the specified render view host. | 66 // provider for the specified render view host. |
| 67 RendererCldDataProvider* CreateRendererCldDataProviderFor( | 67 RendererCldDataProvider* CreateRendererCldDataProviderFor( |
| 68 content::RenderViewObserver*); | 68 content::RenderViewObserver*); |
| 69 | 69 |
| 70 } // namespace translate | 70 } // namespace translate |
| 71 | 71 |
| 72 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATAP_PROVIDER_H_ | 72 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_DATAP_PROVIDER_H_ |
| OLD | NEW |