| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 ExtensionActionManager* extension_action_manager = | 261 ExtensionActionManager* extension_action_manager = |
| 262 ExtensionActionManager::Get(Profile::FromBrowserContext(context)); | 262 ExtensionActionManager::Get(Profile::FromBrowserContext(context)); |
| 263 for (ExtensionSet::const_iterator it = enabled_extensions.begin(); | 263 for (ExtensionSet::const_iterator it = enabled_extensions.begin(); |
| 264 it != enabled_extensions.end(); | 264 it != enabled_extensions.end(); |
| 265 ++it) { | 265 ++it) { |
| 266 ExtensionAction* browser_action = | 266 ExtensionAction* browser_action = |
| 267 extension_action_manager->GetBrowserAction(*it->get()); | 267 extension_action_manager->GetBrowserAction(*it->get()); |
| 268 if (browser_action) { | 268 if (browser_action) { |
| 269 browser_action->ClearAllValuesForTab(SessionID::IdForTab(web_contents())); | 269 browser_action->ClearAllValuesForTab(SessionID::IdForTab(web_contents())); |
| 270 content::NotificationService::current()->Notify( | 270 content::NotificationService::current()->Notify( |
| 271 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 271 extensions::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
| 272 content::Source<ExtensionAction>(browser_action), | 272 content::Source<ExtensionAction>(browser_action), |
| 273 content::NotificationService::NoDetails()); | 273 content::NotificationService::NoDetails()); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 bool TabHelper::OnMessageReceived(const IPC::Message& message) { | 278 bool TabHelper::OnMessageReceived(const IPC::Message& message) { |
| 279 bool handled = true; | 279 bool handled = true; |
| 280 IPC_BEGIN_MESSAGE_MAP(TabHelper, message) | 280 IPC_BEGIN_MESSAGE_MAP(TabHelper, message) |
| 281 IPC_MESSAGE_HANDLER(ChromeExtensionHostMsg_DidGetApplicationInfo, | 281 IPC_MESSAGE_HANDLER(ChromeExtensionHostMsg_DidGetApplicationInfo, |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 } | 563 } |
| 564 } | 564 } |
| 565 | 565 |
| 566 void TabHelper::SetTabId(RenderViewHost* render_view_host) { | 566 void TabHelper::SetTabId(RenderViewHost* render_view_host) { |
| 567 render_view_host->Send( | 567 render_view_host->Send( |
| 568 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), | 568 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), |
| 569 SessionID::IdForTab(web_contents()))); | 569 SessionID::IdForTab(web_contents()))); |
| 570 } | 570 } |
| 571 | 571 |
| 572 } // namespace extensions | 572 } // namespace extensions |
| OLD | NEW |