| 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/flash_ui.h" | 5 #include "chrome/browser/ui/webui/flash_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 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/crash_upload_list.h" | 22 #include "chrome/browser/crash_upload_list.h" |
| 23 #include "chrome/browser/plugin_prefs.h" | 23 #include "chrome/browser/plugin_prefs.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 25 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 26 #include "chrome/browser/ui/webui/crashes_ui.h" | 26 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 27 #include "chrome/common/chrome_version_info.h" | 27 #include "chrome/common/chrome_version_info.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "content/browser/gpu/gpu_data_manager.h" | 29 #include "content/browser/gpu/gpu_data_manager.h" |
| 30 #include "content/browser/plugin_service.h" | 30 #include "content/browser/plugin_service.h" |
| 31 #include "content/browser/tab_contents/tab_contents.h" | 31 #include "content/browser/tab_contents/tab_contents.h" |
| 32 #include "content/browser/user_metrics.h" | 32 #include "content/public/browser/user_metrics.h" |
| 33 #include "grit/browser_resources.h" | 33 #include "grit/browser_resources.h" |
| 34 #include "grit/chromium_strings.h" | 34 #include "grit/chromium_strings.h" |
| 35 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 36 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
| 39 #include "webkit/plugins/webplugininfo.h" | 39 #include "webkit/plugins/webplugininfo.h" |
| 40 | 40 |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 #include "base/win/windows_version.h" | 42 #include "base/win/windows_version.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 using content::UserMetricsAction; |
| 46 |
| 45 namespace { | 47 namespace { |
| 46 | 48 |
| 47 ChromeWebUIDataSource* CreateFlashUIHTMLSource() { | 49 ChromeWebUIDataSource* CreateFlashUIHTMLSource() { |
| 48 ChromeWebUIDataSource* source = | 50 ChromeWebUIDataSource* source = |
| 49 new ChromeWebUIDataSource(chrome::kChromeUIFlashHost); | 51 new ChromeWebUIDataSource(chrome::kChromeUIFlashHost); |
| 50 | 52 |
| 51 source->AddLocalizedString("loadingMessage", IDS_FLASH_LOADING_MESSAGE); | 53 source->AddLocalizedString("loadingMessage", IDS_FLASH_LOADING_MESSAGE); |
| 52 source->AddLocalizedString("flashLongTitle", IDS_FLASH_TITLE_MESSAGE); | 54 source->AddLocalizedString("flashLongTitle", IDS_FLASH_TITLE_MESSAGE); |
| 53 source->set_json_path("strings.js"); | 55 source->set_json_path("strings.js"); |
| 54 source->add_resource_path("about_flash.js", IDR_ABOUT_FLASH_JS); | 56 source->add_resource_path("about_flash.js", IDR_ABOUT_FLASH_JS); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 357 |
| 356 } // namespace | 358 } // namespace |
| 357 | 359 |
| 358 /////////////////////////////////////////////////////////////////////////////// | 360 /////////////////////////////////////////////////////////////////////////////// |
| 359 // | 361 // |
| 360 // FlashUI | 362 // FlashUI |
| 361 // | 363 // |
| 362 /////////////////////////////////////////////////////////////////////////////// | 364 /////////////////////////////////////////////////////////////////////////////// |
| 363 | 365 |
| 364 FlashUI::FlashUI(TabContents* contents) : ChromeWebUI(contents) { | 366 FlashUI::FlashUI(TabContents* contents) : ChromeWebUI(contents) { |
| 365 UserMetrics::RecordAction( | 367 content::RecordAction( |
| 366 UserMetricsAction("ViewAboutFlash")); | 368 UserMetricsAction("ViewAboutFlash")); |
| 367 | 369 |
| 368 AddMessageHandler((new FlashDOMHandler())->Attach(this)); | 370 AddMessageHandler((new FlashDOMHandler())->Attach(this)); |
| 369 | 371 |
| 370 // Set up the about:flash source. | 372 // Set up the about:flash source. |
| 371 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 373 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 372 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); | 374 profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); |
| 373 } | 375 } |
| 374 | 376 |
| 375 // static | 377 // static |
| 376 RefCountedMemory* FlashUI::GetFaviconResourceBytes() { | 378 RefCountedMemory* FlashUI::GetFaviconResourceBytes() { |
| 377 // Use the default icon for now. | 379 // Use the default icon for now. |
| 378 return NULL; | 380 return NULL; |
| 379 } | 381 } |
| OLD | NEW |