| 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/renderer_host/chrome_render_view_host_observer.h" | 5 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/dom_operation_notification_details.h" | 8 #include "chrome/browser/dom_operation_notification_details.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/net/predictor.h" | 10 #include "chrome/browser/net/predictor.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (type == Extension::TYPE_EXTENSION || | 119 if (type == Extension::TYPE_EXTENSION || |
| 120 type == Extension::TYPE_USER_SCRIPT || | 120 type == Extension::TYPE_USER_SCRIPT || |
| 121 type == Extension::TYPE_PACKAGED_APP || | 121 type == Extension::TYPE_PACKAGED_APP || |
| 122 (type == Extension::TYPE_HOSTED_APP && | 122 (type == Extension::TYPE_HOSTED_APP && |
| 123 extension->location() == Extension::COMPONENT)) { | 123 extension->location() == Extension::COMPONENT)) { |
| 124 Send(new ExtensionMsg_ActivateExtension(extension->id())); | 124 Send(new ExtensionMsg_ActivateExtension(extension->id())); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 const Extension* ChromeRenderViewHostObserver::GetExtension() { | 128 const Extension* ChromeRenderViewHostObserver::GetExtension() { |
| 129 // Note that due to ChromeContentBrowserClient::GetEffectiveURL(), even hosted | 129 // Note that due to ChromeContentBrowserClient::GetEffectiveURL(), hosted apps |
| 130 // apps will have a chrome-extension:// URL for their site, so we can ignore | 130 // (excluding bookmark apps) will have a chrome-extension:// URL for their |
| 131 // that wrinkle here. | 131 // site, so we can ignore that wrinkle here. |
| 132 SiteInstance* site_instance = render_view_host()->site_instance(); | 132 SiteInstance* site_instance = render_view_host()->site_instance(); |
| 133 const GURL& site = site_instance->site(); | 133 const GURL& site = site_instance->site(); |
| 134 | 134 |
| 135 if (!site.SchemeIs(chrome::kExtensionScheme)) | 135 if (!site.SchemeIs(chrome::kExtensionScheme)) |
| 136 return NULL; | 136 return NULL; |
| 137 | 137 |
| 138 ExtensionService* service = profile_->GetExtensionService(); | 138 ExtensionService* service = profile_->GetExtensionService(); |
| 139 if (!service) | 139 if (!service) |
| 140 return NULL; | 140 return NULL; |
| 141 | 141 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 167 content::Source<RenderViewHost>(render_view_host()), | 167 content::Source<RenderViewHost>(render_view_host()), |
| 168 content::Details<DomOperationNotificationDetails>(&details)); | 168 content::Details<DomOperationNotificationDetails>(&details)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 171 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
| 172 content::NotificationService::current()->Notify( | 172 content::NotificationService::current()->Notify( |
| 173 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 173 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
| 174 content::Source<RenderViewHost>(render_view_host()), | 174 content::Source<RenderViewHost>(render_view_host()), |
| 175 content::NotificationService::NoDetails()); | 175 content::NotificationService::NoDetails()); |
| 176 } | 176 } |
| OLD | NEW |