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

Side by Side Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698