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 CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DEVICE_ID_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DEVICE_ID_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" | 11 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" |
12 #include "ppapi/host/host_message_context.h" | 12 #include "ppapi/host/host_message_context.h" |
13 #include "ppapi/host/resource_host.h" | 13 #include "ppapi/host/resource_host.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class BrowserPpapiHost; | 16 class BrowserPpapiHost; |
17 } | 17 } |
18 | 18 |
19 namespace IPC { | 19 namespace IPC { |
20 class Message; | 20 class Message; |
21 } | 21 } |
22 | 22 |
23 namespace chrome { | 23 namespace chrome { |
24 | 24 |
25 class PepperFlashDeviceIDHost : public ppapi::host::ResourceHost { | 25 class PepperFlashDRMHost : public ppapi::host::ResourceHost { |
26 public: | 26 public: |
27 PepperFlashDeviceIDHost(content::BrowserPpapiHost* host, | 27 PepperFlashDRMHost(content::BrowserPpapiHost* host, |
28 PP_Instance instance, | 28 PP_Instance instance, |
29 PP_Resource resource); | 29 PP_Resource resource); |
30 virtual ~PepperFlashDeviceIDHost(); | 30 virtual ~PepperFlashDRMHost(); |
31 | 31 |
32 // ResourceHost override. | 32 // ResourceHost override. |
33 virtual int32_t OnResourceMessageReceived( | 33 virtual int32_t OnResourceMessageReceived( |
34 const IPC::Message& msg, | 34 const IPC::Message& msg, |
35 ppapi::host::HostMessageContext* context) OVERRIDE; | 35 ppapi::host::HostMessageContext* context) OVERRIDE; |
36 | 36 |
37 private: | 37 private: |
38 // IPC message handler. | 38 // IPC message handler. |
39 int32_t OnHostMsgGetDeviceID(const ppapi::host::HostMessageContext* context); | 39 int32_t OnHostMsgGetDeviceID(ppapi::host::HostMessageContext* context); |
40 | 40 |
41 // Called by the fetcher when the device ID was retrieved, or the empty string | 41 // Called by the fetcher when the device ID was retrieved, or the empty string |
42 // on error. | 42 // on error. |
43 void GotDeviceID(ppapi::host::ReplyMessageContext reply_context, | 43 void GotDeviceID(ppapi::host::ReplyMessageContext reply_context, |
44 const std::string& contents); | 44 const std::string& id); |
45 | 45 |
46 scoped_refptr<DeviceIDFetcher> fetcher_; | 46 scoped_refptr<DeviceIDFetcher> fetcher_; |
47 | 47 |
48 base::WeakPtrFactory<PepperFlashDeviceIDHost> weak_factory_; | 48 base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(PepperFlashDeviceIDHost); | 50 DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMHost); |
51 }; | 51 }; |
52 | 52 |
53 } // namespace chrome | 53 } // namespace chrome |
54 | 54 |
55 #endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DEVICE_ID_HOST_H_ | 55 #endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ |
OLD | NEW |