| OLD | NEW |
| 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/dom_ui/plugins_ui.h" | 5 #include "chrome/browser/dom_ui/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 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // PluginsUI | 342 // PluginsUI |
| 343 // | 343 // |
| 344 /////////////////////////////////////////////////////////////////////////////// | 344 /////////////////////////////////////////////////////////////////////////////// |
| 345 | 345 |
| 346 PluginsUI::PluginsUI(TabContents* contents) : DOMUI(contents) { | 346 PluginsUI::PluginsUI(TabContents* contents) : DOMUI(contents) { |
| 347 AddMessageHandler((new PluginsDOMHandler())->Attach(this)); | 347 AddMessageHandler((new PluginsDOMHandler())->Attach(this)); |
| 348 | 348 |
| 349 PluginsUIHTMLSource* html_source = new PluginsUIHTMLSource(); | 349 PluginsUIHTMLSource* html_source = new PluginsUIHTMLSource(); |
| 350 | 350 |
| 351 // Set up the chrome://plugins/ source. | 351 // Set up the chrome://plugins/ source. |
| 352 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 352 BrowserThread::PostTask( |
| 353 BrowserThread::IO, FROM_HERE, |
| 354 NewRunnableMethod(ChromeURLDataManager::GetInstance(), |
| 355 &ChromeURLDataManager::AddDataSource, |
| 356 make_scoped_refptr(html_source))); |
| 353 } | 357 } |
| 354 | 358 |
| 355 | 359 |
| 356 // static | 360 // static |
| 357 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { | 361 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { |
| 358 return ResourceBundle::GetSharedInstance(). | 362 return ResourceBundle::GetSharedInstance(). |
| 359 LoadDataResourceBytes(IDR_PLUGIN); | 363 LoadDataResourceBytes(IDR_PLUGIN); |
| 360 } | 364 } |
| 361 | 365 |
| 362 // static | 366 // static |
| 363 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 367 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
| 364 FilePath internal_dir; | 368 FilePath internal_dir; |
| 365 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 369 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
| 366 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 370 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
| 367 internal_dir); | 371 internal_dir); |
| 368 | 372 |
| 369 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); | 373 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); |
| 370 prefs->RegisterListPref(prefs::kPluginsPluginsList); | 374 prefs->RegisterListPref(prefs::kPluginsPluginsList); |
| 371 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); | 375 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); |
| 372 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); | 376 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); |
| 373 } | 377 } |
| OLD | NEW |