Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: chrome/browser/extensions/tab_helper.cc

Issue 10911300: Move ExtensionAction from common/ to browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proof of concept Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/crx_installer.h" 7 #include "chrome/browser/extensions/crx_installer.h"
8 #include "chrome/browser/extensions/app_notify_channel_ui.h" 8 #include "chrome/browser/extensions/app_notify_channel_ui.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_tab_util.h" 10 #include "chrome/browser/extensions/extension_tab_util.h"
11 #include "chrome/browser/extensions/page_action_controller.h" 11 #include "chrome/browser/extensions/page_action_controller.h"
12 #include "chrome/browser/extensions/script_badge_controller.h" 12 #include "chrome/browser/extensions/script_badge_controller.h"
13 #include "chrome/browser/extensions/webstore_inline_installer.h" 13 #include "chrome/browser/extensions/webstore_inline_installer.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/sessions/session_id.h" 15 #include "chrome/browser/sessions/session_id.h"
16 #include "chrome/browser/ui/browser_dialogs.h" 16 #include "chrome/browser/ui/browser_dialogs.h"
17 #include "chrome/browser/ui/tab_contents/tab_contents.h" 17 #include "chrome/browser/ui/tab_contents/tab_contents.h"
18 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" 18 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
19 #include "chrome/browser/ui/web_applications/web_app_ui.h" 19 #include "chrome/browser/ui/web_applications/web_app_ui.h"
20 #include "chrome/browser/web_applications/web_app.h" 20 #include "chrome/browser/web_applications/web_app.h"
21 #include "chrome/common/chrome_notification_types.h" 21 #include "chrome/common/chrome_notification_types.h"
22 #include "chrome/common/extensions/extension_action.h" 22 #include "chrome/browser/extensions/extension_action.h"
23 #include "chrome/common/extensions/extension_constants.h" 23 #include "chrome/common/extensions/extension_constants.h"
24 #include "chrome/common/extensions/extension_icon_set.h" 24 #include "chrome/common/extensions/extension_icon_set.h"
25 #include "chrome/common/extensions/extension_messages.h" 25 #include "chrome/common/extensions/extension_messages.h"
26 #include "chrome/common/extensions/extension_resource.h" 26 #include "chrome/common/extensions/extension_resource.h"
27 #include "chrome/common/extensions/extension_switch_utils.h" 27 #include "chrome/common/extensions/extension_switch_utils.h"
28 #include "content/public/browser/invalidate_type.h" 28 #include "content/public/browser/invalidate_type.h"
29 #include "content/public/browser/navigation_controller.h" 29 #include "content/public/browser/navigation_controller.h"
30 #include "content/public/browser/navigation_details.h" 30 #include "content/public/browser/navigation_details.h"
31 #include "content/public/browser/navigation_entry.h" 31 #include "content/public/browser/navigation_entry.h"
32 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return; 153 return;
154 154
155 Profile* profile = 155 Profile* profile =
156 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 156 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
157 ExtensionService* service = profile->GetExtensionService(); 157 ExtensionService* service = profile->GetExtensionService();
158 if (!service) 158 if (!service)
159 return; 159 return;
160 160
161 for (ExtensionSet::const_iterator it = service->extensions()->begin(); 161 for (ExtensionSet::const_iterator it = service->extensions()->begin();
162 it != service->extensions()->end(); ++it) { 162 it != service->extensions()->end(); ++it) {
163 ExtensionAction* browser_action = (*it)->browser_action(); 163 ExtensionAction* browser_action = GetBrowserAction(profile, **it);
164 if (browser_action) { 164 if (browser_action) {
165 browser_action->ClearAllValuesForTab( 165 browser_action->ClearAllValuesForTab(
166 SessionID::IdForTab(tab_contents_->web_contents())); 166 SessionID::IdForTab(tab_contents_->web_contents()));
167 content::NotificationService::current()->Notify( 167 content::NotificationService::current()->Notify(
168 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, 168 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
169 content::Source<ExtensionAction>(browser_action), 169 content::Source<ExtensionAction>(browser_action),
170 content::NotificationService::NoDetails()); 170 content::NotificationService::NoDetails());
171 } 171 }
172 } 172 }
173 } 173 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // malware site etc). When this happens, we abort the shortcut update. 438 // malware site etc). When this happens, we abort the shortcut update.
439 NavigationEntry* entry = controller.GetLastCommittedEntry(); 439 NavigationEntry* entry = controller.GetLastCommittedEntry();
440 if (entry) 440 if (entry)
441 GetApplicationInfo(entry->GetPageID()); 441 GetApplicationInfo(entry->GetPageID());
442 else 442 else
443 pending_web_app_action_ = NONE; 443 pending_web_app_action_ = NONE;
444 } 444 }
445 } 445 }
446 446
447 } // namespace extensions 447 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698