| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
| 26 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
| 27 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
| 28 #include "chrome/common/extensions/extension_constants.h" | 28 #include "chrome/common/extensions/extension_constants.h" |
| 29 #include "chrome/common/extensions/extension_messages.h" | 29 #include "chrome/common/extensions/extension_messages.h" |
| 30 #include "chrome/common/render_messages.h" | 30 #include "chrome/common/render_messages.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "chrome/common/chrome_view_types.h" | 32 #include "chrome/common/chrome_view_types.h" |
| 33 #include "content/browser/browsing_instance.h" | 33 #include "content/browser/browsing_instance.h" |
| 34 #include "content/browser/renderer_host/browser_render_process_host.h" | |
| 35 #include "content/browser/renderer_host/render_process_host.h" | |
| 36 #include "content/browser/renderer_host/render_view_host.h" | 34 #include "content/browser/renderer_host/render_view_host.h" |
| 37 #include "content/browser/tab_contents/tab_contents.h" | 35 #include "content/browser/tab_contents/tab_contents.h" |
| 38 #include "content/browser/tab_contents/tab_contents_view.h" | 36 #include "content/browser/tab_contents/tab_contents_view.h" |
| 39 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
| 38 #include "content/public/browser/render_process_host.h" |
| 40 #include "content/public/browser/content_browser_client.h" | 39 #include "content/public/browser/content_browser_client.h" |
| 41 #include "content/public/browser/native_web_keyboard_event.h" | 40 #include "content/public/browser/native_web_keyboard_event.h" |
| 42 #include "grit/browser_resources.h" | 41 #include "grit/browser_resources.h" |
| 43 #include "grit/chromium_strings.h" | 42 #include "grit/chromium_strings.h" |
| 44 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
| 45 #include "ui/base/keycodes/keyboard_codes.h" | 44 #include "ui/base/keycodes/keyboard_codes.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
| 47 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 48 | 47 |
| 49 #if defined(TOOLKIT_VIEWS) | 48 #if defined(TOOLKIT_VIEWS) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 #else | 177 #else |
| 179 // TODO(port) | 178 // TODO(port) |
| 180 NOTREACHED(); | 179 NOTREACHED(); |
| 181 #endif | 180 #endif |
| 182 } | 181 } |
| 183 | 182 |
| 184 TabContents* ExtensionHost::GetAssociatedTabContents() const { | 183 TabContents* ExtensionHost::GetAssociatedTabContents() const { |
| 185 return associated_tab_contents_; | 184 return associated_tab_contents_; |
| 186 } | 185 } |
| 187 | 186 |
| 188 RenderProcessHost* ExtensionHost::render_process_host() const { | 187 content::RenderProcessHost* ExtensionHost::render_process_host() const { |
| 189 return host_contents()->GetRenderProcessHost(); | 188 return host_contents()->GetRenderProcessHost(); |
| 190 } | 189 } |
| 191 | 190 |
| 192 RenderViewHost* ExtensionHost::render_view_host() const { | 191 RenderViewHost* ExtensionHost::render_view_host() const { |
| 193 // TODO(mpcomplete): This can be NULL. How do we handle that? | 192 // TODO(mpcomplete): This can be NULL. How do we handle that? |
| 194 return host_contents()->render_view_host(); | 193 return host_contents()->render_view_host(); |
| 195 } | 194 } |
| 196 | 195 |
| 197 bool ExtensionHost::IsRenderViewLive() const { | 196 bool ExtensionHost::IsRenderViewLive() const { |
| 198 return render_view_host()->IsRenderViewLive(); | 197 return render_view_host()->IsRenderViewLive(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); | 503 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); |
| 505 } | 504 } |
| 506 | 505 |
| 507 | 506 |
| 508 void ExtensionHost::RenderViewReady() { | 507 void ExtensionHost::RenderViewReady() { |
| 509 content::NotificationService::current()->Notify( | 508 content::NotificationService::current()->Notify( |
| 510 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 509 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
| 511 content::Source<Profile>(profile_), | 510 content::Source<Profile>(profile_), |
| 512 content::Details<ExtensionHost>(this)); | 511 content::Details<ExtensionHost>(this)); |
| 513 } | 512 } |
| OLD | NEW |