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

Unified Diff: chrome/browser/ui/webui/extensions/extension_info_ui.cc

Issue 785803002: Remove unused WebUI extension files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_info_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/extensions/extension_info_ui.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_info_ui.cc b/chrome/browser/ui/webui/extensions/extension_info_ui.cc
deleted file mode 100644
index 5e1080f5eda57a0b5d72e29a723e96f6b8a0f417..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/extensions/extension_info_ui.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/webui/extensions/extension_info_ui.h"
-
-#include "base/i18n/time_formatting.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/time/time.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
-#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
-#include "chrome/common/extensions/extension_constants.h"
-#include "chrome/common/url_constants.h"
-#include "chrome/grit/generated_resources.h"
-#include "content/public/browser/web_ui.h"
-#include "content/public/browser/web_ui_data_source.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/extension_icon_set.h"
-#include "grit/browser_resources.h"
-
-namespace extensions {
-
-ExtensionInfoUI::ExtensionInfoUI(content::WebUI* web_ui, const GURL& url)
- : content::WebUIController(web_ui),
- source_(content::WebUIDataSource::Create(
- chrome::kChromeUIExtensionInfoHost)) {
- AddExtensionDataToSource(url.path().substr(1));
-
- source_->AddLocalizedString("isRunning",
- IDS_EXTENSION_SCRIPT_POPUP_IS_RUNNING);
- source_->AddLocalizedString("lastUpdated",
- IDS_EXTENSION_SCRIPT_POPUP_LAST_UPDATED);
- source_->SetJsonPath("strings.js");
-
- source_->AddResourcePath("extension_info.css", IDR_EXTENSION_INFO_CSS);
- source_->AddResourcePath("extension_info.js", IDR_EXTENSION_INFO_JS);
- source_->SetDefaultResource(IDR_EXTENSION_INFO_HTML);
-
- Profile* profile = Profile::FromWebUI(web_ui);
- content::WebUIDataSource::Add(profile, source_);
-}
-
-ExtensionInfoUI::~ExtensionInfoUI() {
-}
-
-// static
-GURL ExtensionInfoUI::GetURL(const std::string& extension_id) {
- return GURL(base::StringPrintf(
- "%s%s", chrome::kChromeUIExtensionInfoURL, extension_id.c_str()));
-}
-
-void ExtensionInfoUI::AddExtensionDataToSource(
- const std::string& extension_id) {
- Profile* profile = Profile::FromWebUI(web_ui());
- const Extension* extension =
- ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(
- extension_id);
- if (!extension)
- return;
-
- base::DictionaryValue extension_data;
- GetExtensionBasicInfo(extension, true, &extension_data);
- source_->AddLocalizedStrings(extension_data);
-
- // Set the icon URL.
- GURL icon =
- ExtensionIconSource::GetIconURL(extension,
- extension_misc::EXTENSION_ICON_MEDIUM,
- ExtensionIconSet::MATCH_BIGGER,
- false, NULL);
- source_->AddString("icon", base::UTF8ToUTF16(icon.spec()));
- // Set the last update time (the install time).
- base::Time install_time =
- ExtensionPrefs::Get(profile)->GetInstallTime(extension_id);
- source_->AddString("installTime", base::TimeFormatShortDate(install_time));
-}
-
-} // namespace extensions
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_info_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698