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 BrowserThread::PostTask( | 352 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
353 BrowserThread::IO, FROM_HERE, | |
354 NewRunnableMethod(ChromeURLDataManager::GetInstance(), | |
355 &ChromeURLDataManager::AddDataSource, | |
356 make_scoped_refptr(html_source))); | |
357 } | 353 } |
358 | 354 |
359 | 355 |
360 // static | 356 // static |
361 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { | 357 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { |
362 return ResourceBundle::GetSharedInstance(). | 358 return ResourceBundle::GetSharedInstance(). |
363 LoadDataResourceBytes(IDR_PLUGIN); | 359 LoadDataResourceBytes(IDR_PLUGIN); |
364 } | 360 } |
365 | 361 |
366 // static | 362 // static |
367 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 363 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
368 FilePath internal_dir; | 364 FilePath internal_dir; |
369 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 365 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
370 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 366 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
371 internal_dir); | 367 internal_dir); |
372 | 368 |
373 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); | 369 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); |
374 prefs->RegisterListPref(prefs::kPluginsPluginsList); | 370 prefs->RegisterListPref(prefs::kPluginsPluginsList); |
375 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); | 371 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); |
376 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); | 372 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); |
377 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, true); | 373 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, true); |
378 } | 374 } |
OLD | NEW |