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

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

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed style nit Created 8 years, 8 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/plugins_ui.h" 5 #include "chrome/browser/ui/webui/plugins_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
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/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/plugin_prefs.h" 20 #include "chrome/browser/plugin_prefs.h"
21 #include "chrome/browser/prefs/scoped_user_pref_update.h" 21 #include "chrome/browser/prefs/scoped_user_pref_update.h"
22 #include "chrome/browser/prefs/pref_member.h" 22 #include "chrome/browser/prefs/pref_member.h"
23 #include "chrome/browser/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/ui/browser.h" 25 #include "chrome/browser/ui/browser.h"
26 #include "chrome/browser/ui/browser_window.h" 26 #include "chrome/browser/ui/browser_window.h"
27 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 27 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
28 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 28 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
29 #include "chrome/common/chrome_content_client.h" 29 #include "chrome/common/chrome_content_client.h"
30 #include "chrome/common/chrome_notification_types.h" 30 #include "chrome/common/chrome_notification_types.h"
31 #include "chrome/common/chrome_paths.h" 31 #include "chrome/common/chrome_paths.h"
32 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
34 #include "content/public/browser/notification_source.h" 34 #include "content/public/browser/notification_source.h"
35 #include "content/public/browser/plugin_service.h" 35 #include "content/public/browser/plugin_service.h"
36 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
37 #include "content/public/browser/web_ui.h" 37 #include "content/public/browser/web_ui.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // 468 //
469 // PluginsUI 469 // PluginsUI
470 // 470 //
471 /////////////////////////////////////////////////////////////////////////////// 471 ///////////////////////////////////////////////////////////////////////////////
472 472
473 PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) { 473 PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
474 web_ui->AddMessageHandler(new PluginsDOMHandler()); 474 web_ui->AddMessageHandler(new PluginsDOMHandler());
475 475
476 // Set up the chrome://plugins/ source. 476 // Set up the chrome://plugins/ source.
477 Profile* profile = Profile::FromWebUI(web_ui); 477 Profile* profile = Profile::FromWebUI(web_ui);
478 profile->GetChromeURLDataManager()->AddDataSource( 478 ChromeURLDataManagerFactory::GetForProfile(profile)->AddDataSource(
479 CreatePluginsUIHTMLSource()); 479 CreatePluginsUIHTMLSource());
480 } 480 }
481 481
482 // static 482 // static
483 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { 483 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() {
484 return ResourceBundle::GetSharedInstance(). 484 return ResourceBundle::GetSharedInstance().
485 LoadDataResourceBytes(IDR_PLUGIN); 485 LoadDataResourceBytes(IDR_PLUGIN);
486 } 486 }
487 487
488 // static 488 // static
489 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { 489 void PluginsUI::RegisterUserPrefs(PrefService* prefs) {
490 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, 490 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails,
491 false, 491 false,
492 PrefService::UNSYNCABLE_PREF); 492 PrefService::UNSYNCABLE_PREF);
493 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, 493 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar,
494 true, 494 true,
495 PrefService::UNSYNCABLE_PREF); 495 PrefService::UNSYNCABLE_PREF);
496 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, 496 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist,
497 PrefService::SYNCABLE_PREF); 497 PrefService::SYNCABLE_PREF);
498 } 498 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698