| 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/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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
| 25 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 25 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 26 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 26 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 27 #include "chrome/common/chrome_content_client.h" | 27 #include "chrome/common/chrome_content_client.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "content/browser/webui/web_ui.h" |
| 32 #include "content/public/browser/notification_source.h" | 33 #include "content/public/browser/notification_source.h" |
| 33 #include "content/public/browser/plugin_service.h" | 34 #include "content/public/browser/plugin_service.h" |
| 34 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/browser/web_ui_message_handler.h" | 36 #include "content/public/browser/web_ui_message_handler.h" |
| 36 #include "grit/browser_resources.h" | 37 #include "grit/browser_resources.h" |
| 37 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 38 #include "grit/theme_resources.h" | 39 #include "grit/theme_resources.h" |
| 39 #include "grit/theme_resources_standard.h" | 40 #include "grit/theme_resources_standard.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | 42 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 368 } |
| 368 | 369 |
| 369 } // namespace | 370 } // namespace |
| 370 | 371 |
| 371 /////////////////////////////////////////////////////////////////////////////// | 372 /////////////////////////////////////////////////////////////////////////////// |
| 372 // | 373 // |
| 373 // PluginsUI | 374 // PluginsUI |
| 374 // | 375 // |
| 375 /////////////////////////////////////////////////////////////////////////////// | 376 /////////////////////////////////////////////////////////////////////////////// |
| 376 | 377 |
| 377 PluginsUI::PluginsUI(WebContents* contents) : WebUI(contents, this) { | 378 PluginsUI::PluginsUI(WebUI* web_ui) : WebUIController(web_ui) { |
| 378 AddMessageHandler(new PluginsDOMHandler()); | 379 web_ui->AddMessageHandler(new PluginsDOMHandler()); |
| 379 | 380 |
| 380 // Set up the chrome://plugins/ source. | 381 // Set up the chrome://plugins/ source. |
| 381 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 382 Profile* profile = Profile::FromBrowserContext( |
| 383 web_ui->web_contents()->GetBrowserContext()); |
| 382 profile->GetChromeURLDataManager()->AddDataSource( | 384 profile->GetChromeURLDataManager()->AddDataSource( |
| 383 CreatePluginsUIHTMLSource()); | 385 CreatePluginsUIHTMLSource()); |
| 384 } | 386 } |
| 385 | 387 |
| 386 | 388 |
| 387 // static | 389 // static |
| 388 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { | 390 RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { |
| 389 return ResourceBundle::GetSharedInstance(). | 391 return ResourceBundle::GetSharedInstance(). |
| 390 LoadDataResourceBytes(IDR_PLUGIN); | 392 LoadDataResourceBytes(IDR_PLUGIN); |
| 391 } | 393 } |
| 392 | 394 |
| 393 // static | 395 // static |
| 394 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 396 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
| 395 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, | 397 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, |
| 396 false, | 398 false, |
| 397 PrefService::UNSYNCABLE_PREF); | 399 PrefService::UNSYNCABLE_PREF); |
| 398 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, | 400 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, |
| 399 true, | 401 true, |
| 400 PrefService::UNSYNCABLE_PREF); | 402 PrefService::UNSYNCABLE_PREF); |
| 401 } | 403 } |
| OLD | NEW |