diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 01:18:50 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 01:18:50 +0000 |
commit | 500fd39234346186cf1aeb1ca61e82bf49f5696d (patch) | |
tree | 90ac618782d883d8953dc8df10d9f8a323f9eaa8 | |
parent | b8bbcc27f1302cb3fd3f427992f3c83389108c88 (diff) | |
download | chromium_src-500fd39234346186cf1aeb1ca61e82bf49f5696d.zip chromium_src-500fd39234346186cf1aeb1ca61e82bf49f5696d.tar.gz chromium_src-500fd39234346186cf1aeb1ca61e82bf49f5696d.tar.bz2 |
Merge 202658 "Supresses app permissions changed dialogs in kiosk..."
> Supresses app permissions changed dialogs in kiosk mode.
> Added tweak for running chromeos=1 builds on Linux machines.
>
> BUG=242370
> TEST=manual
>
> Review URL: https://chromiumcodereview.appspot.com/15713003
TBR=zelidrag@chromium.org
Review URL: https://codereview.chromium.org/15684006
git-svn-id: svn://svn.chromium.org/chrome/branches/1500/src@203032 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 12 | ||||
-rw-r--r-- | chrome/browser/usb/usb_service.cc | 37 |
2 files changed, 30 insertions, 19 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 89e50cd..6288075 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -27,6 +27,7 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/version.h" +#include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h" @@ -2193,18 +2194,21 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension, // can upgrade without requiring this user's approval. int disable_reasons = extension_prefs_->GetDisableReasons(extension->id()); - bool is_default_app_install = - (!is_extension_upgrade && extension->was_installed_by_default()); + bool auto_grant_permission = + (!is_extension_upgrade && extension->was_installed_by_default()) || + chrome::IsRunningInForcedAppMode(); // Silently grant all active permissions to default apps only on install. // After install they should behave like other apps. - if (is_default_app_install) + // Silently grant all active permissions to apps install in kiosk mode on both + // install and update. + if (auto_grant_permission) GrantPermissions(extension); bool is_privilege_increase = false; // We only need to compare the granted permissions to the current permissions // if the extension is not allowed to silently increase its permissions. if (!(extension->CanSilentlyIncreasePermissions() || - is_default_app_install)) { + auto_grant_permission)) { // Add all the recognized permissions if the granted permissions list // hasn't been initialized yet. scoped_refptr<PermissionSet> granted_permissions = diff --git a/chrome/browser/usb/usb_service.cc b/chrome/browser/usb/usb_service.cc index fcad23d..ccaeaa6 100644 --- a/chrome/browser/usb/usb_service.cc +++ b/chrome/browser/usb/usb_service.cc @@ -14,6 +14,7 @@ #include "third_party/libusb/src/libusb/libusb.h" #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/permission_broker_client.h" #endif // defined(OS_CHROMEOS) @@ -74,22 +75,28 @@ void UsbService::FindDevices(const uint16 vendor_id, const base::Callback<void()>& callback) { DCHECK(event_handler_) << "FindDevices called after event handler stopped."; #if defined(OS_CHROMEOS) - chromeos::PermissionBrokerClient* client = - chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient(); - DCHECK(client) << "Could not get permission broker client."; - if (!client) { - callback.Run(); - return; - } + // ChromeOS builds on non-ChromeOS machines (dev) should not attempt to + // use permission broker. + if (base::chromeos::IsRunningOnChromeOS()) { + chromeos::PermissionBrokerClient* client = + chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient(); + DCHECK(client) << "Could not get permission broker client."; + if (!client) { + callback.Run(); + return; + } - client->RequestUsbAccess(vendor_id, - product_id, - base::Bind(&UsbService::FindDevicesImpl, - base::Unretained(this), - vendor_id, - product_id, - devices, - callback)); + client->RequestUsbAccess(vendor_id, + product_id, + base::Bind(&UsbService::FindDevicesImpl, + base::Unretained(this), + vendor_id, + product_id, + devices, + callback)); + } else { + FindDevicesImpl(vendor_id, product_id, devices, callback, true); + } #else FindDevicesImpl(vendor_id, product_id, devices, callback, true); #endif // defined(OS_CHROMEOS) |