| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_PLUGINS_PPAPI_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/renderer/pepper/plugin_delegate.h" |
| 10 #include "ppapi/c/private/ppb_network_monitor_private.h" | 11 #include "ppapi/c/private/ppb_network_monitor_private.h" |
| 11 #include "ppapi/shared_impl/resource.h" | 12 #include "ppapi/shared_impl/resource.h" |
| 12 #include "ppapi/thunk/ppb_network_monitor_private_api.h" | 13 #include "ppapi/thunk/ppb_network_monitor_private_api.h" |
| 13 #include "webkit/glue/network_list_observer.h" | 14 #include "webkit/glue/network_list_observer.h" |
| 14 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
| 15 | 15 |
| 16 namespace webkit { | 16 namespace webkit { |
| 17 namespace ppapi { | 17 namespace ppapi { |
| 18 | 18 |
| 19 class PPB_NetworkMonitor_Private_Impl | 19 class PPB_NetworkMonitor_Private_Impl |
| 20 : public ::ppapi::Resource, | 20 : public ::ppapi::Resource, |
| 21 public ::ppapi::thunk::PPB_NetworkMonitor_Private_API, | 21 public ::ppapi::thunk::PPB_NetworkMonitor_Private_API, |
| 22 public webkit_glue::NetworkListObserver { | 22 public webkit_glue::NetworkListObserver { |
| 23 public: | 23 public: |
| 24 static PP_Resource Create(PP_Instance instance, | 24 static PP_Resource Create(PP_Instance instance, |
| 25 PPB_NetworkMonitor_Callback callback, | 25 PPB_NetworkMonitor_Callback callback, |
| 26 void* user_data); | 26 void* user_data); |
| 27 | 27 |
| 28 virtual ~PPB_NetworkMonitor_Private_Impl(); | |
| 29 | |
| 30 virtual ::ppapi::thunk::PPB_NetworkMonitor_Private_API* | 28 virtual ::ppapi::thunk::PPB_NetworkMonitor_Private_API* |
| 31 AsPPB_NetworkMonitor_Private_API() OVERRIDE; | 29 AsPPB_NetworkMonitor_Private_API() OVERRIDE; |
| 32 | 30 |
| 33 // NetworkListObserver interface. | 31 // NetworkListObserver interface. |
| 34 virtual void OnNetworkListChanged( | 32 virtual void OnNetworkListChanged( |
| 35 const net::NetworkInterfaceList& list) OVERRIDE; | 33 const net::NetworkInterfaceList& list) OVERRIDE; |
| 36 | 34 |
| 37 private: | 35 private: |
| 38 PPB_NetworkMonitor_Private_Impl(PP_Instance instance, | 36 PPB_NetworkMonitor_Private_Impl(PP_Instance instance, |
| 39 PPB_NetworkMonitor_Callback callback, | 37 PPB_NetworkMonitor_Callback callback, |
| 40 void* user_data); | 38 void* user_data); |
| 39 virtual ~PPB_NetworkMonitor_Private_Impl(); |
| 41 | 40 |
| 42 bool Start(); | 41 bool Start(); |
| 43 | 42 |
| 44 PPB_NetworkMonitor_Callback callback_; | 43 PPB_NetworkMonitor_Callback callback_; |
| 45 void* user_data_; | 44 void* user_data_; |
| 46 bool started_; | 45 bool started_; |
| 47 | 46 |
| 48 DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Impl); | 47 DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Impl); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 } // namespace ppapi | 50 } // namespace ppapi |
| 52 } // namespace webkit | 51 } // namespace webkit |
| 53 | 52 |
| 54 #endif // WEBKIT_PLUGINS_PPAPI_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ | 53 #endif // CONTENT_RENDERER_PEPPER_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ |
| OLD | NEW |