Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / developer_private / developer_private_api.cc
index e341787..1f95298 100644 (file)
@@ -36,7 +36,6 @@
 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
 #include "chrome/common/extensions/api/developer_private.h"
 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
-#include "chrome/common/extensions/manifest_url_handler.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/grit/generated_resources.h"
 #include "content/public/browser/browser_thread.h"
@@ -46,6 +45,7 @@
 #include "content/public/browser/site_instance.h"
 #include "content/public/browser/storage_partition.h"
 #include "content/public/browser/web_contents.h"
+#include "extensions/browser/api/device_permissions_manager.h"
 #include "extensions/browser/app_window/app_window.h"
 #include "extensions/browser/app_window/app_window_registry.h"
 #include "extensions/browser/extension_error.h"
@@ -65,6 +65,7 @@
 #include "extensions/common/manifest_handlers/incognito_info.h"
 #include "extensions/common/manifest_handlers/offline_enabled_info.h"
 #include "extensions/common/manifest_handlers/options_page_info.h"
+#include "extensions/common/manifest_url_handlers.h"
 #include "extensions/common/permissions/permissions_data.h"
 #include "extensions/common/switches.h"
 #include "extensions/grit/extensions_browser_resources.h"
@@ -562,8 +563,7 @@ ItemInspectViewList DeveloperPrivateGetItemsInfoFunction::
         bool extension_is_enabled) {
   ItemInspectViewList result;
   // Get the extension process's active views.
-  ProcessManager* process_manager =
-      ExtensionSystem::Get(GetProfile())->process_manager();
+  ProcessManager* process_manager = ProcessManager::Get(GetProfile());
   GetInspectablePagesForExtensionProcess(
       extension,
       process_manager->GetRenderViewHostsForExtension(extension->id()),
@@ -589,8 +589,8 @@ ItemInspectViewList DeveloperPrivateGetItemsInfoFunction::
   // app windows for incognito process.
   if (service->profile()->HasOffTheRecordProfile() &&
       IncognitoInfo::IsSplitMode(extension)) {
-    process_manager = ExtensionSystem::Get(
-        service->profile()->GetOffTheRecordProfile())->process_manager();
+    process_manager =
+        ProcessManager::Get(service->profile()->GetOffTheRecordProfile());
     GetInspectablePagesForExtensionProcess(
         extension,
         process_manager->GetRenderViewHostsForExtension(extension->id()),
@@ -758,7 +758,14 @@ bool DeveloperPrivateShowPermissionsDialogFunction::RunSync() {
       retained_file_paths.push_back(retained_file_entries[i].path);
     }
   }
-  prompt_->ReviewPermissions(this, extension, retained_file_paths);
+  std::vector<base::string16> retained_device_messages;
+  if (extension->permissions_data()->HasAPIPermission(APIPermission::kUsb)) {
+    retained_device_messages =
+        extensions::DevicePermissionsManager::Get(GetProfile())
+            ->GetPermissionMessageStrings(extension_id_);
+  }
+  prompt_->ReviewPermissions(
+      this, extension, retained_file_paths, retained_device_messages);
   return true;
 }