OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_info_ui.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 // static | 47 // static |
48 GURL ExtensionInfoUI::GetURL(const std::string& extension_id) { | 48 GURL ExtensionInfoUI::GetURL(const std::string& extension_id) { |
49 return GURL(base::StringPrintf( | 49 return GURL(base::StringPrintf( |
50 "%s%s", chrome::kChromeUIExtensionInfoURL, extension_id.c_str())); | 50 "%s%s", chrome::kChromeUIExtensionInfoURL, extension_id.c_str())); |
51 } | 51 } |
52 | 52 |
53 void ExtensionInfoUI::AddExtensionDataToSource( | 53 void ExtensionInfoUI::AddExtensionDataToSource( |
54 const std::string& extension_id) { | 54 const std::string& extension_id) { |
55 ExtensionService* extension_service = | 55 ExtensionService* extension_service = extensions::ExtensionSystem::Get( |
56 ExtensionSystem::Get(Profile::FromWebUI(web_ui()))->extension_service(); | 56 Profile::FromWebUI(web_ui()))->extension_service(); |
57 const extensions::Extension* extension = | 57 const extensions::Extension* extension = |
58 extension_service->extensions()->GetByID(extension_id); | 58 extension_service->extensions()->GetByID(extension_id); |
59 if (!extension) | 59 if (!extension) |
60 return; | 60 return; |
61 | 61 |
62 extension->GetBasicInfo(true, source_->localized_strings()); | 62 extension->GetBasicInfo(true, source_->localized_strings()); |
63 | 63 |
64 // Set the icon URL. | 64 // Set the icon URL. |
65 GURL icon = | 65 GURL icon = |
66 ExtensionIconSource::GetIconURL(extension, | 66 ExtensionIconSource::GetIconURL(extension, |
67 ExtensionIconSet::EXTENSION_ICON_MEDIUM, | 67 ExtensionIconSet::EXTENSION_ICON_MEDIUM, |
68 ExtensionIconSet::MATCH_BIGGER, | 68 ExtensionIconSet::MATCH_BIGGER, |
69 false, NULL); | 69 false, NULL); |
70 source_->AddString("icon", UTF8ToUTF16(icon.spec())); | 70 source_->AddString("icon", UTF8ToUTF16(icon.spec())); |
71 // Set the last update time (the install time). | 71 // Set the last update time (the install time). |
72 base::Time install_time = extension_service->extension_prefs()-> | 72 base::Time install_time = extension_service->extension_prefs()-> |
73 GetInstallTime(extension_id); | 73 GetInstallTime(extension_id); |
74 source_->AddString("installTime", base::TimeFormatShortDate(install_time)); | 74 source_->AddString("installTime", base::TimeFormatShortDate(install_time)); |
75 } | 75 } |
OLD | NEW |