Skip to content

Commit

Permalink
views: Rename IsAccessibilityFocusableInRootView() to just IsAccessib…
Browse files Browse the repository at this point in the history
…ilityFocusable().

BUG=105879
R=ben@chromium.org

Review URL: http://codereview.chromium.org/9021002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115672 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Dec 23, 2011
1 parent 9be08e1 commit 7419e36
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/views/dropdown_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ DropDownButton::~DropDownButton() {
}

void DropDownButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
if (HasFocus() && (focusable() || IsAccessibilityFocusableInRootView())) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
canvas->DrawFocusRect(gfx::Rect(kFocusFrameLeftOffset, kFocusFrameTopOffset,
width() - kFocusFrameRightOffset,
height() - kFocusFrameBottomOffset));
Expand Down
2 changes: 1 addition & 1 deletion ui/views/controls/button/checkbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void Checkbox::GetAccessibleState(ui::AccessibleViewState* state) {
}

void Checkbox::OnPaintFocusBorder(gfx::Canvas* canvas) {
if (HasFocus() && (focusable() || IsAccessibilityFocusableInRootView())) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
gfx::Rect bounds(GetTextBounds());
// Increate the bounding box by one on each side so that that focus border
// does not draw on top of the letters.
Expand Down
4 changes: 2 additions & 2 deletions ui/views/controls/button/text_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ std::string TextButton::GetClassName() const {
}

void TextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
gfx::Rect rect(GetLocalBounds());
rect.Inset(kFocusRectInset, kFocusRectInset);
canvas->DrawFocusRect(rect);
Expand Down Expand Up @@ -841,7 +841,7 @@ std::string NativeTextButton::GetClassName() const {

void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
#if defined(OS_WIN)
if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
gfx::Rect rect(GetLocalBounds());
rect.Inset(kFocusRectInset, kFocusRectInset);
canvas->DrawFocusRect(rect);
Expand Down
2 changes: 1 addition & 1 deletion ui/views/focus/focus_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void FocusManager::RestoreFocusedView() {
View* view = view_storage->RetrieveView(stored_focused_view_storage_id_);
if (view) {
if (ContainsView(view)) {
if (!view->IsFocusable() && view->IsAccessibilityFocusableInRootView()) {
if (!view->IsFocusable() && view->IsAccessibilityFocusable()) {
// RequestFocus would fail, but we want to restore focus to controls
// that had focus in accessibility mode.
SetFocusedViewWithReason(view, kReasonFocusRestore);
Expand Down
3 changes: 1 addition & 2 deletions ui/views/focus/focus_search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ bool FocusSearch::IsViewFocusableCandidate(View* v, int skip_group_id) {

bool FocusSearch::IsFocusable(View* v) {
if (accessibility_mode_)
return v && v->IsAccessibilityFocusableInRootView();

return v && v->IsAccessibilityFocusable();
return v && v->IsFocusable();
}

Expand Down
7 changes: 3 additions & 4 deletions ui/views/focus/focus_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class VIEWS_EXPORT FocusSearch {
// view to FindNextFocusableView you will always get a valid view
// out, even if it's the same view.
// - |accessibility_mode| should be true if full keyboard accessibility is
// needed and you want to check IsAccessibilityFocusableInRootView(),
// rather than IsFocusable().
// needed and you want to check IsAccessibilityFocusable(), rather than
// IsFocusable().
FocusSearch(View* root, bool cycle, bool accessibility_mode);
virtual ~FocusSearch() {}

Expand Down Expand Up @@ -75,8 +75,7 @@ class VIEWS_EXPORT FocusSearch {
bool IsViewFocusableCandidate(View* v, int skip_group_id);

// Convenience method; returns true if a view is not NULL and is focusable
// (checking IsAccessibilityFocusableInRootView() if accessibility_mode_ is
// true).
// (checking IsAccessibilityFocusable() if |accessibility_mode_| is true).
bool IsFocusable(View* v);

// Returns the view selected for the group of the selected view. If the view
Expand Down
4 changes: 2 additions & 2 deletions ui/views/view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ bool View::IsFocusable() const {
return focusable_ && enabled_ && IsDrawn();
}

bool View::IsAccessibilityFocusableInRootView() const {
bool View::IsAccessibilityFocusable() const {
return (focusable_ || accessibility_focusable_) && enabled_ && IsDrawn();
}

Expand Down Expand Up @@ -1093,7 +1093,7 @@ void View::OnPaintBorder(gfx::Canvas* canvas) {
}

void View::OnPaintFocusBorder(gfx::Canvas* canvas) {
if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
TRACE_EVENT2("views", "views::OnPaintFocusBorder",
"width", canvas->GetSkCanvas()->getDevice()->width(),
"height", canvas->GetSkCanvas()->getDevice()->height());
Expand Down
2 changes: 1 addition & 1 deletion ui/views/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,

// Return whether this view is focusable when the user requires full keyboard
// access, even though it may not be normally focusable.
bool IsAccessibilityFocusableInRootView() const;
bool IsAccessibilityFocusable() const;

// Set whether this view can be made focusable if the user requires
// full keyboard access, even though it's not normally focusable.
Expand Down

0 comments on commit 7419e36

Please sign in to comment.