Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / browser / appcache / appcache_frontend_proxy.cc
1 // Copyright (c) 2011 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 "content/browser/appcache/appcache_frontend_proxy.h"
6
7 #include "content/common/appcache_messages.h"
8
9 namespace content {
10
11 AppCacheFrontendProxy::AppCacheFrontendProxy(IPC::Sender* sender)
12     : sender_(sender) {
13 }
14
15 void AppCacheFrontendProxy::OnCacheSelected(
16     int host_id, const appcache::AppCacheInfo& info) {
17   sender_->Send(new AppCacheMsg_CacheSelected(host_id, info));
18 }
19
20 void AppCacheFrontendProxy::OnStatusChanged(const std::vector<int>& host_ids,
21                                             appcache::Status status) {
22   sender_->Send(new AppCacheMsg_StatusChanged(host_ids, status));
23 }
24
25 void AppCacheFrontendProxy::OnEventRaised(const std::vector<int>& host_ids,
26                                           appcache::EventID event_id) {
27   DCHECK_NE(appcache::PROGRESS_EVENT, event_id);  // See OnProgressEventRaised.
28   sender_->Send(new AppCacheMsg_EventRaised(host_ids, event_id));
29 }
30
31 void AppCacheFrontendProxy::OnProgressEventRaised(
32     const std::vector<int>& host_ids,
33     const GURL& url, int num_total, int num_complete) {
34   sender_->Send(new AppCacheMsg_ProgressEventRaised(
35       host_ids, url, num_total, num_complete));
36 }
37
38 void AppCacheFrontendProxy::OnErrorEventRaised(
39     const std::vector<int>& host_ids,
40     const appcache::ErrorDetails& details) {
41   sender_->Send(new AppCacheMsg_ErrorEventRaised(host_ids, details));
42 }
43
44 void AppCacheFrontendProxy::OnLogMessage(int host_id,
45                                          appcache::LogLevel log_level,
46                                          const std::string& message) {
47   sender_->Send(new AppCacheMsg_LogMessage(host_id, log_level, message));
48 }
49
50 void AppCacheFrontendProxy::OnContentBlocked(int host_id,
51                                              const GURL& manifest_url) {
52   sender_->Send(new AppCacheMsg_ContentBlocked(host_id, manifest_url));
53 }
54
55 }  // namespace content