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 "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/extensions/activity_log/activity_log.h" | 12 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 13 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" |
13 #include "chrome/browser/extensions/api/declarative_content/chrome_content_rules
_registry.h" | 14 #include "chrome/browser/extensions/api/declarative_content/chrome_content_rules
_registry.h" |
14 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 15 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
15 #include "chrome/browser/extensions/bookmark_app_helper.h" | 16 #include "chrome/browser/extensions/bookmark_app_helper.h" |
16 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 17 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
17 #include "chrome/browser/extensions/extension_action_runner.h" | 18 #include "chrome/browser/extensions/extension_action_runner.h" |
18 #include "chrome/browser/extensions/extension_tab_util.h" | 19 #include "chrome/browser/extensions/extension_tab_util.h" |
19 #include "chrome/browser/extensions/extension_util.h" | 20 #include "chrome/browser/extensions/extension_util.h" |
20 #include "chrome/browser/extensions/install_observer.h" | 21 #include "chrome/browser/extensions/install_observer.h" |
21 #include "chrome/browser/extensions/install_tracker.h" | 22 #include "chrome/browser/extensions/install_tracker.h" |
22 #include "chrome/browser/extensions/install_tracker_factory.h" | 23 #include "chrome/browser/extensions/install_tracker_factory.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 InvokeForContentRulesRegistries([this](ContentRulesRegistry* registry) { | 178 InvokeForContentRulesRegistries([this](ContentRulesRegistry* registry) { |
178 registry->MonitorWebContentsForRuleEvaluation(this->web_contents()); | 179 registry->MonitorWebContentsForRuleEvaluation(this->web_contents()); |
179 }); | 180 }); |
180 | 181 |
181 // We need an ExtensionWebContentsObserver, so make sure one exists (this is | 182 // We need an ExtensionWebContentsObserver, so make sure one exists (this is |
182 // a no-op if one already does). | 183 // a no-op if one already does). |
183 ChromeExtensionWebContentsObserver::CreateForWebContents(web_contents); | 184 ChromeExtensionWebContentsObserver::CreateForWebContents(web_contents); |
184 ExtensionWebContentsObserver::GetForWebContents(web_contents)->dispatcher()-> | 185 ExtensionWebContentsObserver::GetForWebContents(web_contents)->dispatcher()-> |
185 set_delegate(this); | 186 set_delegate(this); |
186 | 187 |
| 188 BookmarkManagerPrivateDragEventRouter::MaybeCreateForWebContents( |
| 189 web_contents); |
| 190 |
187 registrar_.Add(this, | 191 registrar_.Add(this, |
188 content::NOTIFICATION_LOAD_STOP, | 192 content::NOTIFICATION_LOAD_STOP, |
189 content::Source<NavigationController>( | 193 content::Source<NavigationController>( |
190 &web_contents->GetController())); | 194 &web_contents->GetController())); |
191 } | 195 } |
192 | 196 |
193 TabHelper::~TabHelper() { | 197 TabHelper::~TabHelper() { |
194 RemoveScriptExecutionObserver(ActivityLog::GetInstance(profile_)); | 198 RemoveScriptExecutionObserver(ActivityLog::GetInstance(profile_)); |
195 } | 199 } |
196 | 200 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 679 } |
676 } | 680 } |
677 | 681 |
678 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) { | 682 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) { |
679 render_frame_host->Send( | 683 render_frame_host->Send( |
680 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(), | 684 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(), |
681 SessionTabHelper::IdForTab(web_contents()))); | 685 SessionTabHelper::IdForTab(web_contents()))); |
682 } | 686 } |
683 | 687 |
684 } // namespace extensions | 688 } // namespace extensions |
OLD | NEW |