| 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_EXTENSIONS_EXTENSION_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/timer/elapsed_timer.h" | 13 #include "base/timer/elapsed_timer.h" |
| 14 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 14 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/web_contents_delegate.h" | 17 #include "content/public/browser/web_contents_delegate.h" |
| 18 #include "content/public/browser/web_contents_observer.h" | 18 #include "content/public/browser/web_contents_observer.h" |
| 19 #include "extensions/common/stack_frame.h" | 19 #include "extensions/common/stack_frame.h" |
| 20 #include "extensions/common/view_type.h" | 20 #include "extensions/common/view_type.h" |
| 21 | 21 |
| 22 class ExtensionService; |
| 22 class PrefsTabHelper; | 23 class PrefsTabHelper; |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 class BrowserContext; | 26 class BrowserContext; |
| 26 class RenderProcessHost; | 27 class RenderProcessHost; |
| 27 class RenderWidgetHostView; | 28 class RenderWidgetHostView; |
| 28 class SiteInstance; | 29 class SiteInstance; |
| 29 } | 30 } |
| 30 | 31 |
| 31 namespace extensions { | 32 namespace extensions { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 122 |
| 122 // Closes this host (results in deletion). | 123 // Closes this host (results in deletion). |
| 123 void Close(); | 124 void Close(); |
| 124 | 125 |
| 125 private: | 126 private: |
| 126 friend class ProcessCreationQueue; | 127 friend class ProcessCreationQueue; |
| 127 | 128 |
| 128 // Actually create the RenderView for this host. See CreateRenderViewSoon. | 129 // Actually create the RenderView for this host. See CreateRenderViewSoon. |
| 129 void CreateRenderViewNow(); | 130 void CreateRenderViewNow(); |
| 130 | 131 |
| 132 // Returns the ExtensionService for |browser_context_| or NULL if none exists. |
| 133 ExtensionService* GetExtensionService(); |
| 134 |
| 131 // Message handlers. | 135 // Message handlers. |
| 132 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 136 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
| 133 void OnEventAck(); | 137 void OnEventAck(); |
| 134 void OnIncrementLazyKeepaliveCount(); | 138 void OnIncrementLazyKeepaliveCount(); |
| 135 void OnDecrementLazyKeepaliveCount(); | 139 void OnDecrementLazyKeepaliveCount(); |
| 136 void OnDetailedConsoleMessageAdded( | 140 void OnDetailedConsoleMessageAdded( |
| 137 const base::string16& message, | 141 const base::string16& message, |
| 138 const base::string16& source, | 142 const base::string16& source, |
| 139 const StackTrace& stack_trace, | 143 const StackTrace& stack_trace, |
| 140 int32 severity_level); | 144 int32 severity_level); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 178 |
| 175 // Used to measure how long it's been since the host was created. | 179 // Used to measure how long it's been since the host was created. |
| 176 base::ElapsedTimer since_created_; | 180 base::ElapsedTimer since_created_; |
| 177 | 181 |
| 178 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 182 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 179 }; | 183 }; |
| 180 | 184 |
| 181 } // namespace extensions | 185 } // namespace extensions |
| 182 | 186 |
| 183 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 187 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |