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

Side by Side Diff: chrome/browser/ui/webui/conflicts_ui.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/conflicts_ui.h" 5 #include "chrome/browser/ui/webui/conflicts_ui.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/enumerate_modules_model_win.h" 16 #include "chrome/browser/enumerate_modules_model_win.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
22 #include "content/browser/tab_contents/tab_contents.h" 22 #include "content/browser/tab_contents/tab_contents.h"
23 #include "content/browser/user_metrics.h" 23 #include "content/browser/user_metrics.h"
24 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #include "content/common/notification_service.h" 26 #include "content/public/browser/notification_service.h"
27 #include "grit/browser_resources.h" 27 #include "grit/browser_resources.h"
28 #include "grit/chromium_strings.h" 28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 29 #include "grit/generated_resources.h"
30 #include "grit/theme_resources.h" 30 #include "grit/theme_resources.h"
31 #include "grit/theme_resources_standard.h" 31 #include "grit/theme_resources_standard.h"
32 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/resource/resource_bundle.h" 33 #include "ui/base/resource/resource_bundle.h"
34 34
35 namespace { 35 namespace {
36 36
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 void ConflictsDOMHandler::RegisterMessages() { 96 void ConflictsDOMHandler::RegisterMessages() {
97 web_ui_->RegisterMessageCallback("requestModuleList", 97 web_ui_->RegisterMessageCallback("requestModuleList",
98 base::Bind(&ConflictsDOMHandler::HandleRequestModuleList, 98 base::Bind(&ConflictsDOMHandler::HandleRequestModuleList,
99 base::Unretained(this))); 99 base::Unretained(this)));
100 } 100 }
101 101
102 void ConflictsDOMHandler::HandleRequestModuleList(const ListValue* args) { 102 void ConflictsDOMHandler::HandleRequestModuleList(const ListValue* args) {
103 // This request is handled asynchronously. See Observe for when we reply back. 103 // This request is handled asynchronously. See Observe for when we reply back.
104 registrar_.Add(this, chrome::NOTIFICATION_MODULE_LIST_ENUMERATED, 104 registrar_.Add(this, chrome::NOTIFICATION_MODULE_LIST_ENUMERATED,
105 NotificationService::AllSources()); 105 content::NotificationService::AllSources());
106 EnumerateModulesModel::GetInstance()->ScanNow(); 106 EnumerateModulesModel::GetInstance()->ScanNow();
107 } 107 }
108 108
109 void ConflictsDOMHandler::SendModuleList() { 109 void ConflictsDOMHandler::SendModuleList() {
110 EnumerateModulesModel* loaded_modules = EnumerateModulesModel::GetInstance(); 110 EnumerateModulesModel* loaded_modules = EnumerateModulesModel::GetInstance();
111 ListValue* list = loaded_modules->GetModuleList(); 111 ListValue* list = loaded_modules->GetModuleList();
112 DictionaryValue results; 112 DictionaryValue results;
113 results.Set("moduleList", list); 113 results.Set("moduleList", list);
114 114
115 // Add the section title and the total count for bad modules found. 115 // Add the section title and the total count for bad modules found.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 CreateConflictsUIHTMLSource()); 164 CreateConflictsUIHTMLSource());
165 } 165 }
166 166
167 // static 167 // static
168 RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() { 168 RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() {
169 return ResourceBundle::GetSharedInstance(). 169 return ResourceBundle::GetSharedInstance().
170 LoadDataResourceBytes(IDR_CONFLICT_FAVICON); 170 LoadDataResourceBytes(IDR_CONFLICT_FAVICON);
171 } 171 }
172 172
173 #endif 173 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/collected_cookies_ui_delegate.cc ('k') | chrome/browser/ui/webui/html_dialog_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698