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

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

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased Created 4 years, 7 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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