OLD | NEW |
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/chrome_url_data_manager.h" | 10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 ChromeWebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost); | 28 ChromeWebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost); |
29 | 29 |
30 // Localized strings. | 30 // Localized strings. |
31 source->AddLocalizedString("extensionActivity", IDS_EXTENSION_ACTIVITY_TITLE); | 31 source->AddLocalizedString("extensionActivity", IDS_EXTENSION_ACTIVITY_TITLE); |
32 source->AddLocalizedString("extensionActivityApiCall", | 32 source->AddLocalizedString("extensionActivityApiCall", |
33 IDS_EXTENSION_ACTIVITY_API_CALL); | 33 IDS_EXTENSION_ACTIVITY_API_CALL); |
34 source->AddLocalizedString("extensionActivityApiBlock", | 34 source->AddLocalizedString("extensionActivityApiBlock", |
35 IDS_EXTENSION_ACTIVITY_API_BLOCK); | 35 IDS_EXTENSION_ACTIVITY_API_BLOCK); |
36 source->AddLocalizedString("extensionActivityContentScript", | 36 source->AddLocalizedString("extensionActivityContentScript", |
37 IDS_EXTENSION_ACTIVITY_CONTENT_SCRIPT); | 37 IDS_EXTENSION_ACTIVITY_CONTENT_SCRIPT); |
| 38 source->AddLocalizedString("extensionActivityEventDispatch", |
| 39 IDS_EXTENSION_ACTIVITY_EVENT_DISPATCH); |
38 source->SetUseJsonJSFormatV2(); | 40 source->SetUseJsonJSFormatV2(); |
39 source->SetJsonPath("strings.js"); | 41 source->SetJsonPath("strings.js"); |
40 | 42 |
41 // Resources. | 43 // Resources. |
42 source->AddResourcePath("extension_activity.js", IDR_EXTENSION_ACTIVITY_JS); | 44 source->AddResourcePath("extension_activity.js", IDR_EXTENSION_ACTIVITY_JS); |
43 source->SetDefaultResource(IDR_EXTENSION_ACTIVITY_HTML); | 45 source->SetDefaultResource(IDR_EXTENSION_ACTIVITY_HTML); |
44 profile_ = Profile::FromWebUI(web_ui); | 46 profile_ = Profile::FromWebUI(web_ui); |
45 ChromeURLDataManager::AddWebUIDataSource(profile_, source); | 47 ChromeURLDataManager::AddWebUIDataSource(profile_, source); |
46 ChromeURLDataManager::AddDataSource( | 48 ChromeURLDataManager::AddDataSource( |
47 profile_, new SharedResourcesDataSource()); | 49 profile_, new SharedResourcesDataSource()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 scoped_ptr<ListValue> messages_list(new ListValue()); | 102 scoped_ptr<ListValue> messages_list(new ListValue()); |
101 messages_list->AppendString(message); | 103 messages_list->AppendString(message); |
102 | 104 |
103 DictionaryValue result; | 105 DictionaryValue result; |
104 result.SetInteger("activity", activity); | 106 result.SetInteger("activity", activity); |
105 result.Set("messages", messages_list.release()); | 107 result.Set("messages", messages_list.release()); |
106 | 108 |
107 web_ui()->CallJavascriptFunction("extension_activity.handleExtensionActivity", | 109 web_ui()->CallJavascriptFunction("extension_activity.handleExtensionActivity", |
108 result); | 110 result); |
109 } | 111 } |
OLD | NEW |