| 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/tab_helper.h" | 5 #include "chrome/browser/extensions/tab_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/activity_log/activity_log.h" | 10 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void TabHelper::RenderViewCreated(RenderViewHost* render_view_host) { | 192 void TabHelper::RenderViewCreated(RenderViewHost* render_view_host) { |
| 193 SetTabId(render_view_host); | 193 SetTabId(render_view_host); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void TabHelper::DidNavigateMainFrame( | 196 void TabHelper::DidNavigateMainFrame( |
| 197 const content::LoadCommittedDetails& details, | 197 const content::LoadCommittedDetails& details, |
| 198 const content::FrameNavigateParams& params) { | 198 const content::FrameNavigateParams& params) { |
| 199 #if defined(ENABLE_EXTENSIONS) | 199 #if defined(ENABLE_EXTENSIONS) |
| 200 if (ExtensionSystem::Get(profile_)->extension_service() && | 200 if (ExtensionSystem::Get(profile_)->extension_service() && |
| 201 RulesRegistryService::Get(profile_)) { | 201 RulesRegistryService::Get(profile_)) { |
| 202 RulesRegistryService::Get(profile_)->content_rules_registry()-> | 202 RulesRegistryService::Get(profile_)->GetContentRulesRegistry()-> |
| 203 DidNavigateMainFrame(web_contents(), details, params); | 203 DidNavigateMainFrame(web_contents(), details, params); |
| 204 } | 204 } |
| 205 #endif // defined(ENABLE_EXTENSIONS) | 205 #endif // defined(ENABLE_EXTENSIONS) |
| 206 | 206 |
| 207 if (details.is_in_page) | 207 if (details.is_in_page) |
| 208 return; | 208 return; |
| 209 | 209 |
| 210 Profile* profile = | 210 Profile* profile = |
| 211 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 211 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 212 ExtensionService* service = profile->GetExtensionService(); | 212 ExtensionService* service = profile->GetExtensionService(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 executing_scripts_map, | 344 executing_scripts_map, |
| 345 on_page_id, | 345 on_page_id, |
| 346 on_url)); | 346 on_url)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void TabHelper::OnWatchedPageChange( | 349 void TabHelper::OnWatchedPageChange( |
| 350 const std::vector<std::string>& css_selectors) { | 350 const std::vector<std::string>& css_selectors) { |
| 351 #if defined(ENABLE_EXTENSIONS) | 351 #if defined(ENABLE_EXTENSIONS) |
| 352 if (ExtensionSystem::Get(profile_)->extension_service() && | 352 if (ExtensionSystem::Get(profile_)->extension_service() && |
| 353 RulesRegistryService::Get(profile_)) { | 353 RulesRegistryService::Get(profile_)) { |
| 354 RulesRegistryService::Get(profile_)->content_rules_registry()->Apply( | 354 RulesRegistryService::Get(profile_)->GetContentRulesRegistry()-> |
| 355 web_contents(), css_selectors); | 355 Apply(web_contents(), css_selectors); |
| 356 } | 356 } |
| 357 #endif // defined(ENABLE_EXTENSIONS) | 357 #endif // defined(ENABLE_EXTENSIONS) |
| 358 } | 358 } |
| 359 | 359 |
| 360 void TabHelper::OnDetailedConsoleMessageAdded( | 360 void TabHelper::OnDetailedConsoleMessageAdded( |
| 361 const base::string16& message, | 361 const base::string16& message, |
| 362 const base::string16& source, | 362 const base::string16& source, |
| 363 const StackTrace& stack_trace, | 363 const StackTrace& stack_trace, |
| 364 int32 severity_level) { | 364 int32 severity_level) { |
| 365 if (IsSourceFromAnExtension(source)) { | 365 if (IsSourceFromAnExtension(source)) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 | 489 |
| 490 void TabHelper::SetTabId(RenderViewHost* render_view_host) { | 490 void TabHelper::SetTabId(RenderViewHost* render_view_host) { |
| 491 render_view_host->Send( | 491 render_view_host->Send( |
| 492 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), | 492 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), |
| 493 SessionID::IdForTab(web_contents()))); | 493 SessionID::IdForTab(web_contents()))); |
| 494 } | 494 } |
| 495 | 495 |
| 496 } // namespace extensions | 496 } // namespace extensions |
| OLD | NEW |