| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/views/apps/app_info_dialog/app_info_permissions_pane
l.h" | 5 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_pane
l.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 rb.GetImageNamed(IDR_DISABLE).ToImageSkia()); | 55 rb.GetImageNamed(IDR_DISABLE).ToImageSkia()); |
| 56 SetImage(views::CustomButton::STATE_HOVERED, | 56 SetImage(views::CustomButton::STATE_HOVERED, |
| 57 rb.GetImageNamed(IDR_DISABLE_H).ToImageSkia()); | 57 rb.GetImageNamed(IDR_DISABLE_H).ToImageSkia()); |
| 58 SetImage(views::CustomButton::STATE_PRESSED, | 58 SetImage(views::CustomButton::STATE_PRESSED, |
| 59 rb.GetImageNamed(IDR_DISABLE_P).ToImageSkia()); | 59 rb.GetImageNamed(IDR_DISABLE_P).ToImageSkia()); |
| 60 SetBorder(std::unique_ptr<views::Border>()); | 60 SetBorder(std::unique_ptr<views::Border>()); |
| 61 SetSize(GetPreferredSize()); | 61 SetSize(GetPreferredSize()); |
| 62 | 62 |
| 63 // Make the button focusable & give it alt-text so permissions can be | 63 // Make the button focusable & give it alt-text so permissions can be |
| 64 // revoked using only the keyboard. | 64 // revoked using only the keyboard. |
| 65 SetFocusBehavior(FocusBehavior::ALWAYS); | 65 Button::ConfigureDefaultFocus(this); |
| 66 SetTooltipText(l10n_util::GetStringFUTF16( | 66 SetTooltipText(l10n_util::GetStringFUTF16( |
| 67 IDS_APPLICATION_INFO_REVOKE_PERMISSION_ALT_TEXT, permission_message)); | 67 IDS_APPLICATION_INFO_REVOKE_PERMISSION_ALT_TEXT, permission_message)); |
| 68 } | 68 } |
| 69 ~RevokeButton() override {} | 69 ~RevokeButton() override {} |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Overridden from views::ButtonListener. | 72 // Overridden from views::ButtonListener. |
| 73 void ButtonPressed(views::Button* sender, const ui::Event& event) override { | 73 void ButtonPressed(views::Button* sender, const ui::Event& event) override { |
| 74 DCHECK_EQ(this, sender); | 74 DCHECK_EQ(this, sender); |
| 75 if (!callback_.is_null()) | 75 if (!callback_.is_null()) |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return extensions::DevicePermissionsManager::Get(profile_) | 330 return extensions::DevicePermissionsManager::Get(profile_) |
| 331 ->GetPermissionMessageStrings(app_->id()); | 331 ->GetPermissionMessageStrings(app_->id()); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void AppInfoPermissionsPanel::RevokeDevicePermissions() { | 334 void AppInfoPermissionsPanel::RevokeDevicePermissions() { |
| 335 extensions::DevicePermissionsManager::Get(profile_)->Clear(app_->id()); | 335 extensions::DevicePermissionsManager::Get(profile_)->Clear(app_->id()); |
| 336 apps::AppLoadService::Get(profile_)->RestartApplicationIfRunning(app_->id()); | 336 apps::AppLoadService::Get(profile_)->RestartApplicationIfRunning(app_->id()); |
| 337 | 337 |
| 338 Close(); | 338 Close(); |
| 339 } | 339 } |
| OLD | NEW |