| 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 #include "chrome/browser/extensions/api/runtime/runtime_api.h" | 5 #include "chrome/browser/extensions/api/runtime/runtime_api.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
| 8 #include "chrome/browser/extensions/extension_event_router.h" | 8 #include "chrome/browser/extensions/extension_event_router.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| 11 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
| 12 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 12 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 const char kOnInstalledEvent[] = "experimental.runtime.onInstalled"; | 18 const char kOnInstalledEvent[] = "runtime.onInstalled"; |
| 19 const char kNoBackgroundPageError[] = "You do not have a background page."; | 19 const char kNoBackgroundPageError[] = "You do not have a background page."; |
| 20 const char kPageLoadError[] = "Background page failed to load."; | 20 const char kPageLoadError[] = "Background page failed to load."; |
| 21 | 21 |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace extensions { | 24 namespace extensions { |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 void RuntimeEventRouter::DispatchOnInstalledEvent( | 27 void RuntimeEventRouter::DispatchOnInstalledEvent( |
| 28 Profile* profile, const std::string& extension_id) { | 28 Profile* profile, const std::string& extension_id) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost* host) { | 63 void RuntimeGetBackgroundPageFunction::OnPageLoaded(ExtensionHost* host) { |
| 64 if (host) { | 64 if (host) { |
| 65 SendResponse(true); | 65 SendResponse(true); |
| 66 } else { | 66 } else { |
| 67 error_ = kPageLoadError; | 67 error_ = kPageLoadError; |
| 68 SendResponse(false); | 68 SendResponse(false); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace extensions | 72 } // namespace extensions |
| OLD | NEW |