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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_activity_ui.cc

Issue 11946028: Record event activity to the extension activity log. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename ActivityLog::IsLoggingEnabled Created 7 years, 10 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
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/ui/webui/extensions/extension_activity_ui.h" 5 #include "chrome/browser/ui/webui/extensions/extension_activity_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 10 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
(...skipping 15 matching lines...) Expand all
26 content::WebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost); 26 content::WebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost);
27 27
28 // Localized strings. 28 // Localized strings.
29 source->AddLocalizedString("extensionActivity", IDS_EXTENSION_ACTIVITY_TITLE); 29 source->AddLocalizedString("extensionActivity", IDS_EXTENSION_ACTIVITY_TITLE);
30 source->AddLocalizedString("extensionActivityApiCall", 30 source->AddLocalizedString("extensionActivityApiCall",
31 IDS_EXTENSION_ACTIVITY_API_CALL); 31 IDS_EXTENSION_ACTIVITY_API_CALL);
32 source->AddLocalizedString("extensionActivityApiBlock", 32 source->AddLocalizedString("extensionActivityApiBlock",
33 IDS_EXTENSION_ACTIVITY_API_BLOCK); 33 IDS_EXTENSION_ACTIVITY_API_BLOCK);
34 source->AddLocalizedString("extensionActivityContentScript", 34 source->AddLocalizedString("extensionActivityContentScript",
35 IDS_EXTENSION_ACTIVITY_CONTENT_SCRIPT); 35 IDS_EXTENSION_ACTIVITY_CONTENT_SCRIPT);
36 source->AddLocalizedString("extensionActivityEventDispatch",
37 IDS_EXTENSION_ACTIVITY_EVENT_DISPATCH);
36 source->SetUseJsonJSFormatV2(); 38 source->SetUseJsonJSFormatV2();
37 source->SetJsonPath("strings.js"); 39 source->SetJsonPath("strings.js");
38 40
39 // Resources. 41 // Resources.
40 source->AddResourcePath("extension_activity.js", IDR_EXTENSION_ACTIVITY_JS); 42 source->AddResourcePath("extension_activity.js", IDR_EXTENSION_ACTIVITY_JS);
41 source->SetDefaultResource(IDR_EXTENSION_ACTIVITY_HTML); 43 source->SetDefaultResource(IDR_EXTENSION_ACTIVITY_HTML);
42 profile_ = Profile::FromWebUI(web_ui); 44 profile_ = Profile::FromWebUI(web_ui);
43 content::WebUIDataSource::Add(profile_, source); 45 content::WebUIDataSource::Add(profile_, source);
44 // Callback handlers. 46 // Callback handlers.
45 web_ui->RegisterMessageCallback("requestExtensionData", 47 web_ui->RegisterMessageCallback("requestExtensionData",
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 scoped_ptr<ListValue> messages_list(new ListValue()); 97 scoped_ptr<ListValue> messages_list(new ListValue());
96 messages_list->AppendString(message); 98 messages_list->AppendString(message);
97 99
98 DictionaryValue result; 100 DictionaryValue result;
99 result.SetInteger("activity", activity); 101 result.SetInteger("activity", activity);
100 result.Set("messages", messages_list.release()); 102 result.Set("messages", messages_list.release());
101 103
102 web_ui()->CallJavascriptFunction("extension_activity.handleExtensionActivity", 104 web_ui()->CallJavascriptFunction("extension_activity.handleExtensionActivity",
103 result); 105 result);
104 } 106 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extension_activity.html ('k') | chrome/test/data/extensions/activity_log/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698