| 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/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
| 11 #include "chrome/browser/extensions/api/developer_private/developer_private_api_
factory.h" | 11 #include "chrome/browser/extensions/api/developer_private/developer_private_api_
factory.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/extension_system.h" | 13 #include "chrome/browser/extensions/extension_system.h" |
| 14 #include "chrome/browser/extensions/management_policy.h" | 14 #include "chrome/browser/extensions/management_policy.h" |
| 15 #include "chrome/browser/extensions/updater/extension_updater.h" | 15 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 17 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 18 #include "chrome/browser/view_type_utils.h" | 18 #include "chrome/browser/view_type_utils.h" |
| 19 #include "chrome/common/extensions/api/developer_private.h" | 19 #include "chrome/common/extensions/api/developer_private.h" |
| 20 #include "chrome/common/extensions/api/url_parser/url_info.h" |
| 20 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 | 26 |
| 26 using content::RenderViewHost; | 27 using content::RenderViewHost; |
| 27 using extensions::DeveloperPrivateAPI; | 28 using extensions::DeveloperPrivateAPI; |
| 28 using extensions::Extension; | 29 using extensions::Extension; |
| 29 using extensions::ExtensionSystem; | 30 using extensions::ExtensionSystem; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 info->is_unpacked = (item.location() == Extension::LOAD); | 92 info->is_unpacked = (item.location() == Extension::LOAD); |
| 92 | 93 |
| 93 GURL icon = | 94 GURL icon = |
| 94 ExtensionIconSource::GetIconURL(&item, | 95 ExtensionIconSource::GetIconURL(&item, |
| 95 extension_misc::EXTENSION_ICON_MEDIUM, | 96 extension_misc::EXTENSION_ICON_MEDIUM, |
| 96 ExtensionIconSet::MATCH_BIGGER, | 97 ExtensionIconSet::MATCH_BIGGER, |
| 97 !info->enabled, | 98 !info->enabled, |
| 98 NULL); | 99 NULL); |
| 99 info->icon = icon.spec(); | 100 info->icon = icon.spec(); |
| 100 | 101 |
| 101 info->homepage_url.reset(new std::string(item.GetHomepageURL().spec())); | 102 info->homepage_url.reset(new std::string(extensions::URLInfo::url( |
| 103 &item, extensions::URLInfo::HOMEPAGE_URL).spec())); |
| 102 if (!item.options_url().is_empty()) { | 104 if (!item.options_url().is_empty()) { |
| 103 info->options_url.reset(new std::string(item.options_url().spec())); | 105 info->options_url.reset(new std::string(item.options_url().spec())); |
| 104 } | 106 } |
| 105 | 107 |
| 106 if (!item.update_url().is_empty()) { | 108 if (!item.update_url().is_empty()) { |
| 107 info->update_url.reset(new std::string( | 109 info->update_url.reset(new std::string( |
| 108 item.update_url().spec())); | 110 item.update_url().spec())); |
| 109 } | 111 } |
| 110 | 112 |
| 111 if (item.is_app()) { | 113 if (item.is_app()) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 287 |
| 286 DevToolsWindow::OpenDevToolsWindow(host); | 288 DevToolsWindow::OpenDevToolsWindow(host); |
| 287 return true; | 289 return true; |
| 288 } | 290 } |
| 289 | 291 |
| 290 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} | 292 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} |
| 291 | 293 |
| 292 } // namespace api | 294 } // namespace api |
| 293 | 295 |
| 294 } // namespace extensions | 296 } // namespace extensions |
| OLD | NEW |