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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2982533002: Remove the BubbleFrameView close button from tab traversal on all platforms. (Closed)
Patch Set: update comment Created 3 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 *rb->GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia()); 126 *rb->GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
127 close_button->SetImage( 127 close_button->SetImage(
128 CustomButton::STATE_HOVERED, 128 CustomButton::STATE_HOVERED,
129 *rb->GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia()); 129 *rb->GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
130 close_button->SetImage( 130 close_button->SetImage(
131 CustomButton::STATE_PRESSED, 131 CustomButton::STATE_PRESSED,
132 *rb->GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia()); 132 *rb->GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
133 } 133 }
134 close_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_APP_CLOSE)); 134 close_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_APP_CLOSE));
135 close_button->SizeToPreferredSize(); 135 close_button->SizeToPreferredSize();
136
137 // Remove the close button from tab traversal on all platforms. Note this does
138 // not affect screen readers' ability to focus the close button. Keyboard
139 // access to the close button when not using a screen reader is done via the
140 // ESC key handler in DialogClientView.
141 close_button->SetFocusBehavior(View::FocusBehavior::NEVER);
136 return close_button; 142 return close_button;
137 } 143 }
138 144
139 gfx::Rect BubbleFrameView::GetBoundsForClientView() const { 145 gfx::Rect BubbleFrameView::GetBoundsForClientView() const {
140 gfx::Rect client_bounds = GetContentsBounds(); 146 gfx::Rect client_bounds = GetContentsBounds();
141 client_bounds.Inset(GetInsets()); 147 client_bounds.Inset(GetInsets());
142 if (footnote_container_) { 148 if (footnote_container_) {
143 client_bounds.set_height(client_bounds.height() - 149 client_bounds.set_height(client_bounds.height() -
144 footnote_container_->height()); 150 footnote_container_->height());
145 } 151 }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 570
565 DialogDelegate* dialog_delegate = 571 DialogDelegate* dialog_delegate =
566 GetWidget()->widget_delegate()->AsDialogDelegate(); 572 GetWidget()->widget_delegate()->AsDialogDelegate();
567 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) 573 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth())
568 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); 574 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width()));
569 575
570 return size; 576 return size;
571 } 577 }
572 578
573 } // namespace views 579 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698