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

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

Issue 11421192: Save extension activity log to a file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: something about lkgr Created 7 years, 11 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
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | chrome/browser/extensions/url_actions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } else { 96 } else {
97 location_bar_controller_.reset( 97 location_bar_controller_.reset(
98 new PageActionController(web_contents)); 98 new PageActionController(web_contents));
99 } 99 }
100 100
101 if (FeatureSwitch::script_bubble()->IsEnabled()) { 101 if (FeatureSwitch::script_bubble()->IsEnabled()) {
102 script_bubble_controller_.reset( 102 script_bubble_controller_.reset(
103 new ScriptBubbleController(web_contents, this)); 103 new ScriptBubbleController(web_contents, this));
104 } 104 }
105 105
106
106 // If more classes need to listen to global content script activity, then 107 // If more classes need to listen to global content script activity, then
107 // a separate routing class with an observer interface should be written. 108 // a separate routing class with an observer interface should be written.
108 AddScriptExecutionObserver(ActivityLog::GetInstance()); 109 profile_ = Profile::FromBrowserContext(web_contents->GetBrowserContext());
110 AddScriptExecutionObserver(ActivityLog::GetInstance(profile_));
109 111
110 registrar_.Add(this, 112 registrar_.Add(this,
111 content::NOTIFICATION_LOAD_STOP, 113 content::NOTIFICATION_LOAD_STOP,
112 content::Source<NavigationController>( 114 content::Source<NavigationController>(
113 &web_contents->GetController())); 115 &web_contents->GetController()));
114 116
115 registrar_.Add(this, 117 registrar_.Add(this,
116 chrome::NOTIFICATION_EXTENSION_UNLOADED, 118 chrome::NOTIFICATION_EXTENSION_UNLOADED,
117 content::NotificationService::AllSources()); 119 content::NotificationService::AllSources());
118 } 120 }
119 121
120 TabHelper::~TabHelper() { 122 TabHelper::~TabHelper() {
121 RemoveScriptExecutionObserver(ActivityLog::GetInstance()); 123 RemoveScriptExecutionObserver(ActivityLog::GetInstance(profile_));
122 } 124 }
123 125
124 void TabHelper::CreateApplicationShortcuts() { 126 void TabHelper::CreateApplicationShortcuts() {
125 DCHECK(CanCreateApplicationShortcuts()); 127 DCHECK(CanCreateApplicationShortcuts());
126 NavigationEntry* entry = 128 NavigationEntry* entry =
127 web_contents()->GetController().GetLastCommittedEntry(); 129 web_contents()->GetController().GetLastCommittedEntry();
128 if (!entry) 130 if (!entry)
129 return; 131 return;
130 132
131 pending_web_app_action_ = CREATE_SHORTCUT; 133 pending_web_app_action_ = CREATE_SHORTCUT;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 script_bubble_controller_->OnExtensionUnloaded( 514 script_bubble_controller_->OnExtensionUnloaded(
513 content::Details<extensions::UnloadedExtensionInfo>( 515 content::Details<extensions::UnloadedExtensionInfo>(
514 details)->extension->id()); 516 details)->extension->id());
515 break; 517 break;
516 } 518 }
517 } 519 }
518 } 520 }
519 } 521 }
520 522
521 } // namespace extensions 523 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | chrome/browser/extensions/url_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698