| 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 #include "chrome/browser/extensions/extension_gcm_app_handler.h" | 5 #include "chrome/browser/extensions/extension_gcm_app_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ++extension) { | 61 ++extension) { |
| 62 if (IsGCMPermissionEnabled(extension->get())) | 62 if (IsGCMPermissionEnabled(extension->get())) |
| 63 GetGCMDriver()->RemoveAppHandler((*extension)->id()); | 63 GetGCMDriver()->RemoveAppHandler((*extension)->id()); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 void ExtensionGCMAppHandler::ShutdownHandler() { | 67 void ExtensionGCMAppHandler::ShutdownHandler() { |
| 68 js_event_router_.reset(); | 68 js_event_router_.reset(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ExtensionGCMAppHandler::OnStoreReset() { |
| 72 // TODO(johnme): Notify the extension somehow that its registration was |
| 73 // invalidated and deleted? |
| 74 } |
| 75 |
| 71 void ExtensionGCMAppHandler::OnMessage(const std::string& app_id, | 76 void ExtensionGCMAppHandler::OnMessage(const std::string& app_id, |
| 72 const gcm::IncomingMessage& message) { | 77 const gcm::IncomingMessage& message) { |
| 73 js_event_router_->OnMessage(app_id, message); | 78 js_event_router_->OnMessage(app_id, message); |
| 74 } | 79 } |
| 75 | 80 |
| 76 void ExtensionGCMAppHandler::OnMessagesDeleted(const std::string& app_id) { | 81 void ExtensionGCMAppHandler::OnMessagesDeleted(const std::string& app_id) { |
| 77 js_event_router_->OnMessagesDeleted(app_id); | 82 js_event_router_->OnMessagesDeleted(app_id); |
| 78 } | 83 } |
| 79 | 84 |
| 80 void ExtensionGCMAppHandler::OnSendError( | 85 void ExtensionGCMAppHandler::OnSendError( |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 198 |
| 194 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { | 199 void ExtensionGCMAppHandler::AddAppHandler(const std::string& app_id) { |
| 195 GetGCMDriver()->AddAppHandler(app_id, this); | 200 GetGCMDriver()->AddAppHandler(app_id, this); |
| 196 } | 201 } |
| 197 | 202 |
| 198 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { | 203 void ExtensionGCMAppHandler::RemoveAppHandler(const std::string& app_id) { |
| 199 GetGCMDriver()->RemoveAppHandler(app_id); | 204 GetGCMDriver()->RemoveAppHandler(app_id); |
| 200 } | 205 } |
| 201 | 206 |
| 202 } // namespace extensions | 207 } // namespace extensions |
| OLD | NEW |