• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 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 "components/gcm_driver/default_gcm_app_handler.h"
6 
7 #include "base/logging.h"
8 #include "net/base/ip_endpoint.h"
9 
10 namespace gcm {
11 
DefaultGCMAppHandler()12 DefaultGCMAppHandler::DefaultGCMAppHandler() {
13 }
14 
~DefaultGCMAppHandler()15 DefaultGCMAppHandler::~DefaultGCMAppHandler() {
16 }
17 
ShutdownHandler()18 void DefaultGCMAppHandler::ShutdownHandler() {
19   // Nothing to do.
20 }
21 
OnMessage(const std::string & app_id,const GCMClient::IncomingMessage & message)22 void DefaultGCMAppHandler::OnMessage(
23     const std::string& app_id,
24     const GCMClient::IncomingMessage& message) {
25   LOG(ERROR) << "No app handler is found to route message for " << app_id;
26 }
27 
OnMessagesDeleted(const std::string & app_id)28 void DefaultGCMAppHandler::OnMessagesDeleted(const std::string& app_id) {
29   LOG(ERROR) << "No app handler is found to route deleted message for "
30              << app_id;
31 }
32 
OnSendError(const std::string & app_id,const GCMClient::SendErrorDetails & send_error_details)33 void DefaultGCMAppHandler::OnSendError(
34     const std::string& app_id,
35     const GCMClient::SendErrorDetails& send_error_details) {
36   LOG(ERROR) << "No app handler is found to route send error message for "
37              << app_id;
38 }
39 
OnConnected(const net::IPEndPoint & ip_endpoint)40 void DefaultGCMAppHandler::OnConnected(const net::IPEndPoint& ip_endpoint) {
41   // TODO(semenzato): update CrOS NIC state.
42   DVLOG(1) << "GCM connected to " << ip_endpoint.ToString();
43 }
44 
OnDisconnected()45 void DefaultGCMAppHandler::OnDisconnected() {
46   // TODO(semenzato): update CrOS NIC state.
47   DVLOG(1) << "GCM disconnected";
48 }
49 
50 }  // namespace gcm
51