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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 explicit RevokeButton(const base::Closure& callback, | 50 explicit RevokeButton(const base::Closure& callback, |
51 base::string16 permission_message) | 51 base::string16 permission_message) |
52 : views::ImageButton(this), callback_(callback) { | 52 : views::ImageButton(this), callback_(callback) { |
53 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 53 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
54 SetImage(views::CustomButton::STATE_NORMAL, | 54 SetImage(views::CustomButton::STATE_NORMAL, |
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(scoped_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 SetFocusable(true); | 65 SetFocusable(true); |
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 |
(...skipping 259 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 |