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_tab_helper.h" | 5 #include "chrome/browser/extensions/extension_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/webstore_inline_installer.h" | 8 #include "chrome/browser/extensions/webstore_inline_installer.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/restore_tab_helper.h" | 10 #include "chrome/browser/sessions/restore_tab_helper.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const content::FrameNavigateParams& params) { | 91 const content::FrameNavigateParams& params) { |
92 if (details.is_in_page) | 92 if (details.is_in_page) |
93 return; | 93 return; |
94 | 94 |
95 Profile* profile = | 95 Profile* profile = |
96 Profile::FromBrowserContext(tab_contents()->browser_context()); | 96 Profile::FromBrowserContext(tab_contents()->browser_context()); |
97 ExtensionService* service = profile->GetExtensionService(); | 97 ExtensionService* service = profile->GetExtensionService(); |
98 if (!service) | 98 if (!service) |
99 return; | 99 return; |
100 | 100 |
101 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 101 for (size_t i = 0; i < service->extensions()->size(); ++i) { |
102 it != service->extensions()->end(); ++it) { | 102 ExtensionAction* browser_action = |
103 ExtensionAction* browser_action = (*it)->browser_action(); | 103 service->extensions()->at(i)->browser_action(); |
104 if (browser_action) { | 104 if (browser_action) { |
105 browser_action->ClearAllValuesForTab( | 105 browser_action->ClearAllValuesForTab( |
106 wrapper_->restore_tab_helper()->session_id().id()); | 106 wrapper_->restore_tab_helper()->session_id().id()); |
107 content::NotificationService::current()->Notify( | 107 content::NotificationService::current()->Notify( |
108 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 108 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
109 content::Source<ExtensionAction>(browser_action), | 109 content::Source<ExtensionAction>(browser_action), |
110 content::NotificationService::NoDetails()); | 110 content::NotificationService::NoDetails()); |
111 } | 111 } |
112 | 112 |
113 ExtensionAction* page_action = (*it)->page_action(); | 113 ExtensionAction* page_action = |
| 114 service->extensions()->at(i)->page_action(); |
114 if (page_action) { | 115 if (page_action) { |
115 page_action->ClearAllValuesForTab( | 116 page_action->ClearAllValuesForTab( |
116 wrapper_->restore_tab_helper()->session_id().id()); | 117 wrapper_->restore_tab_helper()->session_id().id()); |
117 PageActionStateChanged(); | 118 PageActionStateChanged(); |
118 } | 119 } |
119 } | 120 } |
120 } | 121 } |
121 | 122 |
122 bool ExtensionTabHelper::OnMessageReceived(const IPC::Message& message) { | 123 bool ExtensionTabHelper::OnMessageReceived(const IPC::Message& message) { |
123 bool handled = true; | 124 bool handled = true; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 281 } |
281 | 282 |
282 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { | 283 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { |
283 return tab_contents(); | 284 return tab_contents(); |
284 } | 285 } |
285 | 286 |
286 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { | 287 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { |
287 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); | 288 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); |
288 return rwhv ? rwhv->GetNativeView() : NULL; | 289 return rwhv ? rwhv->GetNativeView() : NULL; |
289 } | 290 } |
OLD | NEW |