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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 580363002: Update app info and install prompt UI to show retained devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback from Avi and tapted. Created 6 years, 3 months 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 unified diff | Download patch
OLDNEW
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 "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/saved_devices_service.h"
8 #include "apps/saved_files_service.h" 9 #include "apps/saved_files_service.h"
9 #include "base/base64.h" 10 #include "base/base64.h"
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/files/file_enumerator.h" 13 #include "base/files/file_enumerator.h"
13 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
14 #include "base/i18n/file_util_icu.h" 15 #include "base/i18n/file_util_icu.h"
15 #include "base/lazy_instance.h" 16 #include "base/lazy_instance.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 std::vector<base::FilePath> retained_file_paths; 752 std::vector<base::FilePath> retained_file_paths;
752 if (extension->permissions_data()->HasAPIPermission( 753 if (extension->permissions_data()->HasAPIPermission(
753 APIPermission::kFileSystem)) { 754 APIPermission::kFileSystem)) {
754 std::vector<apps::SavedFileEntry> retained_file_entries = 755 std::vector<apps::SavedFileEntry> retained_file_entries =
755 apps::SavedFilesService::Get(GetProfile()) 756 apps::SavedFilesService::Get(GetProfile())
756 ->GetAllFileEntries(extension_id_); 757 ->GetAllFileEntries(extension_id_);
757 for (size_t i = 0; i < retained_file_entries.size(); i++) { 758 for (size_t i = 0; i < retained_file_entries.size(); i++) {
758 retained_file_paths.push_back(retained_file_entries[i].path); 759 retained_file_paths.push_back(retained_file_entries[i].path);
759 } 760 }
760 } 761 }
761 prompt_->ReviewPermissions(this, extension, retained_file_paths); 762 std::vector<base::string16> retained_device_messages;
763 if (extension->permissions_data()->HasAPIPermission(APIPermission::kUsb)) {
764 retained_device_messages = apps::SavedDevicesService::Get(GetProfile())
765 ->GetPermissionMessageStrings(extension_id_);
766 }
767 prompt_->ReviewPermissions(
768 this, extension, retained_file_paths, retained_device_messages);
762 return true; 769 return true;
763 } 770 }
764 771
765 DeveloperPrivateReloadFunction::~DeveloperPrivateReloadFunction() {} 772 DeveloperPrivateReloadFunction::~DeveloperPrivateReloadFunction() {}
766 773
767 // This is called when the user clicks "Revoke File Access." 774 // This is called when the user clicks "Revoke File Access."
768 void DeveloperPrivateShowPermissionsDialogFunction::InstallUIProceed() { 775 void DeveloperPrivateShowPermissionsDialogFunction::InstallUIProceed() {
769 Profile* profile = GetProfile(); 776 Profile* profile = GetProfile();
770 const Extension* extension = ExtensionRegistry::Get( 777 const Extension* extension = ExtensionRegistry::Get(
771 profile)->GetExtensionById(extension_id_, ExtensionRegistry::EVERYTHING); 778 profile)->GetExtensionById(extension_id_, ExtensionRegistry::EVERYTHING);
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 } 1402 }
1396 1403
1397 error_ui_util::HandleOpenDevTools(dict); 1404 error_ui_util::HandleOpenDevTools(dict);
1398 1405
1399 return true; 1406 return true;
1400 } 1407 }
1401 1408
1402 } // namespace api 1409 } // namespace api
1403 1410
1404 } // namespace extensions 1411 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698