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

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

Issue 11014009: Beginnings of the script bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yozments Created 8 years, 2 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/activity_log.h" 7 #include "chrome/browser/extensions/activity_log.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/crx_installer.h" 9 #include "chrome/browser/extensions/crx_installer.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/extensions/extension_tab_util.h" 11 #include "chrome/browser/extensions/extension_tab_util.h"
12 #include "chrome/browser/extensions/page_action_controller.h" 12 #include "chrome/browser/extensions/page_action_controller.h"
13 #include "chrome/browser/extensions/script_badge_controller.h" 13 #include "chrome/browser/extensions/script_badge_controller.h"
14 #include "chrome/browser/extensions/script_bubble_controller.h"
14 #include "chrome/browser/extensions/webstore_inline_installer.h" 15 #include "chrome/browser/extensions/webstore_inline_installer.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/sessions/session_id.h" 17 #include "chrome/browser/sessions/session_id.h"
17 #include "chrome/browser/sessions/session_tab_helper.h" 18 #include "chrome/browser/sessions/session_tab_helper.h"
18 #include "chrome/browser/ui/browser_dialogs.h" 19 #include "chrome/browser/ui/browser_dialogs.h"
19 #include "chrome/browser/ui/tab_contents/tab_contents.h" 20 #include "chrome/browser/ui/tab_contents/tab_contents.h"
20 #include "chrome/browser/ui/web_applications/web_app_ui.h" 21 #include "chrome/browser/ui/web_applications/web_app_ui.h"
21 #include "chrome/browser/web_applications/web_app.h" 22 #include "chrome/browser/web_applications/web_app.h"
22 #include "chrome/common/chrome_notification_types.h" 23 #include "chrome/common/chrome_notification_types.h"
23 #include "chrome/common/extensions/extension_action.h" 24 #include "chrome/common/extensions/extension_action.h"
24 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
25 #include "chrome/common/extensions/extension_icon_set.h" 26 #include "chrome/common/extensions/extension_icon_set.h"
26 #include "chrome/common/extensions/extension_messages.h" 27 #include "chrome/common/extensions/extension_messages.h"
27 #include "chrome/common/extensions/extension_resource.h" 28 #include "chrome/common/extensions/extension_resource.h"
28 #include "chrome/common/extensions/extension_switch_utils.h" 29 #include "chrome/common/extensions/extension_switch_utils.h"
30 #include "chrome/common/extensions/feature_switch.h"
29 #include "content/public/browser/invalidate_type.h" 31 #include "content/public/browser/invalidate_type.h"
30 #include "content/public/browser/navigation_controller.h" 32 #include "content/public/browser/navigation_controller.h"
31 #include "content/public/browser/navigation_details.h" 33 #include "content/public/browser/navigation_details.h"
32 #include "content/public/browser/navigation_entry.h" 34 #include "content/public/browser/navigation_entry.h"
33 #include "content/public/browser/notification_service.h" 35 #include "content/public/browser/notification_service.h"
34 #include "content/public/browser/notification_source.h" 36 #include "content/public/browser/notification_source.h"
35 #include "content/public/browser/notification_types.h" 37 #include "content/public/browser/notification_types.h"
36 #include "content/public/browser/render_process_host.h" 38 #include "content/public/browser/render_process_host.h"
37 #include "content/public/browser/render_view_host.h" 39 #include "content/public/browser/render_view_host.h"
38 #include "content/public/browser/render_widget_host_view.h" 40 #include "content/public/browser/render_widget_host_view.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 SessionID::IdForTab(web_contents), 87 SessionID::IdForTab(web_contents),
86 Profile::FromBrowserContext(web_contents->GetBrowserContext()))); 88 Profile::FromBrowserContext(web_contents->GetBrowserContext())));
87 if (switch_utils::AreScriptBadgesEnabled()) { 89 if (switch_utils::AreScriptBadgesEnabled()) {
88 location_bar_controller_.reset( 90 location_bar_controller_.reset(
89 new ScriptBadgeController(web_contents, &script_executor_, this)); 91 new ScriptBadgeController(web_contents, &script_executor_, this));
90 } else { 92 } else {
91 location_bar_controller_.reset( 93 location_bar_controller_.reset(
92 new PageActionController(web_contents)); 94 new PageActionController(web_contents));
93 } 95 }
94 96
97 if (FeatureSwitch::GetScriptBubble()->IsEnabled())
98 script_bubble_controller_.reset(new ScriptBubbleController(this));
99
95 // If more classes need to listen to global content script activity, then 100 // If more classes need to listen to global content script activity, then
96 // a separate routing class with an observer interface should be written. 101 // a separate routing class with an observer interface should be written.
97 AddContentScriptObserver(ActivityLog::GetInstance()); 102 AddContentScriptObserver(ActivityLog::GetInstance());
98 103
99 registrar_.Add(this, 104 registrar_.Add(this,
100 content::NOTIFICATION_LOAD_STOP, 105 content::NOTIFICATION_LOAD_STOP,
101 content::Source<NavigationController>( 106 content::Source<NavigationController>(
102 &web_contents->GetController())); 107 &web_contents->GetController()));
103 } 108 }
104 109
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // malware site etc). When this happens, we abort the shortcut update. 491 // malware site etc). When this happens, we abort the shortcut update.
487 NavigationEntry* entry = controller.GetLastCommittedEntry(); 492 NavigationEntry* entry = controller.GetLastCommittedEntry();
488 if (entry) 493 if (entry)
489 GetApplicationInfo(entry->GetPageID()); 494 GetApplicationInfo(entry->GetPageID());
490 else 495 else
491 pending_web_app_action_ = NONE; 496 pending_web_app_action_ = NONE;
492 } 497 }
493 } 498 }
494 499
495 } // namespace extensions 500 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698