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

Side by Side Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.cc

Issue 1067113002: Reland: Add an event to notify accessibility when a permissions bubble gets shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise/relocate comment Created 5 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/website_settings/permissions_bubble_view.h" 5 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 void Close(); 161 void Close();
162 void SizeToContents(); 162 void SizeToContents();
163 163
164 // BubbleDelegateView: 164 // BubbleDelegateView:
165 bool ShouldShowCloseButton() const override; 165 bool ShouldShowCloseButton() const override;
166 bool ShouldShowWindowTitle() const override; 166 bool ShouldShowWindowTitle() const override;
167 const gfx::FontList& GetTitleFontList() const override; 167 const gfx::FontList& GetTitleFontList() const override;
168 base::string16 GetWindowTitle() const override; 168 base::string16 GetWindowTitle() const override;
169 void OnWidgetDestroying(views::Widget* widget) override; 169 void OnWidgetDestroying(views::Widget* widget) override;
170 void GetAccessibleState(ui::AXViewState* state) override;
170 171
171 // ButtonListener: 172 // ButtonListener:
172 void ButtonPressed(views::Button* button, const ui::Event& event) override; 173 void ButtonPressed(views::Button* button, const ui::Event& event) override;
173 174
174 // PermissionCombobox::Listener: 175 // PermissionCombobox::Listener:
175 void PermissionSelectionChanged(int index, bool allowed) override; 176 void PermissionSelectionChanged(int index, bool allowed) override;
176 177
177 // Updates the anchor's arrow and view. Also repositions the bubble so it's 178 // Updates the anchor's arrow and view. Also repositions the bubble so it's
178 // displayed in the correct location. 179 // displayed in the correct location.
179 void UpdateAnchor(views::View* anchor_view, 180 void UpdateAnchor(views::View* anchor_view,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 345 }
345 346
346 void PermissionsBubbleDelegateView::OnWidgetDestroying(views::Widget* widget) { 347 void PermissionsBubbleDelegateView::OnWidgetDestroying(views::Widget* widget) {
347 views::BubbleDelegateView::OnWidgetDestroying(widget); 348 views::BubbleDelegateView::OnWidgetDestroying(widget);
348 if (owner_) { 349 if (owner_) {
349 owner_->Closing(); 350 owner_->Closing();
350 owner_ = nullptr; 351 owner_ = nullptr;
351 } 352 }
352 } 353 }
353 354
355 void PermissionsBubbleDelegateView::GetAccessibleState(ui::AXViewState* state) {
356 views::BubbleDelegateView::GetAccessibleState(state);
357 state->role = ui::AX_ROLE_ALERT_DIALOG;
358 }
359
354 void PermissionsBubbleDelegateView::ButtonPressed(views::Button* button, 360 void PermissionsBubbleDelegateView::ButtonPressed(views::Button* button,
355 const ui::Event& event) { 361 const ui::Event& event) {
356 if (!owner_) 362 if (!owner_)
357 return; 363 return;
358 364
359 if (button == allow_) 365 if (button == allow_)
360 owner_->Accept(); 366 owner_->Accept();
361 else if (button == deny_) 367 else if (button == deny_)
362 owner_->Deny(); 368 owner_->Deny();
363 } 369 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 482
477 void PermissionBubbleViewViews::Accept() { 483 void PermissionBubbleViewViews::Accept() {
478 if (delegate_) 484 if (delegate_)
479 delegate_->Accept(); 485 delegate_->Accept();
480 } 486 }
481 487
482 void PermissionBubbleViewViews::Deny() { 488 void PermissionBubbleViewViews::Deny() {
483 if (delegate_) 489 if (delegate_)
484 delegate_->Deny(); 490 delegate_->Deny();
485 } 491 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js ('k') | ui/views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698