| 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/extension_urls/extension_urls_handler.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( |
| 102 if (!item.options_url().is_empty()) { | 103 ExtensionURL::GetHomepageURL(&item).spec())); |
| 103 info->options_url.reset(new std::string(item.options_url().spec())); | 104 if (!ExtensionURL::GetOptionsURL(&item).is_empty()) { |
| 105 info->options_url.reset( |
| 106 new std::string(ExtensionURL::GetOptionsURL(&item).spec())); |
| 104 } | 107 } |
| 105 | 108 |
| 106 if (!item.update_url().is_empty()) { | 109 if (!ExtensionURL::GetUpdateURL(&item).is_empty()) { |
| 107 info->update_url.reset(new std::string( | 110 info->update_url.reset(new std::string( |
| 108 item.update_url().spec())); | 111 ExtensionURL::GetUpdateURL(&item).spec())); |
| 109 } | 112 } |
| 110 | 113 |
| 111 if (item.is_app()) { | 114 if (item.is_app()) { |
| 112 info->app_launch_url.reset(new std::string( | 115 info->app_launch_url.reset(new std::string( |
| 113 item.GetFullLaunchURL().spec())); | 116 item.GetFullLaunchURL().spec())); |
| 114 } | 117 } |
| 115 | 118 |
| 116 info->may_disable = system->management_policy()-> | 119 info->may_disable = system->management_policy()-> |
| 117 UserMayModifySettings(&item, NULL); | 120 UserMayModifySettings(&item, NULL); |
| 118 info->is_app = item.is_app(); | 121 info->is_app = item.is_app(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 288 |
| 286 DevToolsWindow::OpenDevToolsWindow(host); | 289 DevToolsWindow::OpenDevToolsWindow(host); |
| 287 return true; | 290 return true; |
| 288 } | 291 } |
| 289 | 292 |
| 290 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} | 293 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} |
| 291 | 294 |
| 292 } // namespace api | 295 } // namespace api |
| 293 | 296 |
| 294 } // namespace extensions | 297 } // namespace extensions |
| OLD | NEW |