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

Side by Side Diff: ui/views/view.cc

Issue 9021002: views: Rename IsAccessibilityFocusableInRootView() to just IsAccessibilityFocusable(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/view.h ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/view.h" 5 #include "ui/views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 891
892 void View::SetNextFocusableView(View* view) { 892 void View::SetNextFocusableView(View* view) {
893 view->previous_focusable_view_ = this; 893 view->previous_focusable_view_ = this;
894 next_focusable_view_ = view; 894 next_focusable_view_ = view;
895 } 895 }
896 896
897 bool View::IsFocusable() const { 897 bool View::IsFocusable() const {
898 return focusable_ && enabled_ && IsDrawn(); 898 return focusable_ && enabled_ && IsDrawn();
899 } 899 }
900 900
901 bool View::IsAccessibilityFocusableInRootView() const { 901 bool View::IsAccessibilityFocusable() const {
902 return (focusable_ || accessibility_focusable_) && enabled_ && IsDrawn(); 902 return (focusable_ || accessibility_focusable_) && enabled_ && IsDrawn();
903 } 903 }
904 904
905 FocusManager* View::GetFocusManager() { 905 FocusManager* View::GetFocusManager() {
906 Widget* widget = GetWidget(); 906 Widget* widget = GetWidget();
907 return widget ? widget->GetFocusManager() : NULL; 907 return widget ? widget->GetFocusManager() : NULL;
908 } 908 }
909 909
910 const FocusManager* View::GetFocusManager() const { 910 const FocusManager* View::GetFocusManager() const {
911 const Widget* widget = GetWidget(); 911 const Widget* widget = GetWidget();
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 void View::OnPaintBorder(gfx::Canvas* canvas) { 1086 void View::OnPaintBorder(gfx::Canvas* canvas) {
1087 if (border_.get()) { 1087 if (border_.get()) {
1088 TRACE_EVENT2("views", "View::OnPaintBorder", 1088 TRACE_EVENT2("views", "View::OnPaintBorder",
1089 "width", canvas->GetSkCanvas()->getDevice()->width(), 1089 "width", canvas->GetSkCanvas()->getDevice()->width(),
1090 "height", canvas->GetSkCanvas()->getDevice()->height()); 1090 "height", canvas->GetSkCanvas()->getDevice()->height());
1091 border_->Paint(*this, canvas); 1091 border_->Paint(*this, canvas);
1092 } 1092 }
1093 } 1093 }
1094 1094
1095 void View::OnPaintFocusBorder(gfx::Canvas* canvas) { 1095 void View::OnPaintFocusBorder(gfx::Canvas* canvas) {
1096 if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) { 1096 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
1097 TRACE_EVENT2("views", "views::OnPaintFocusBorder", 1097 TRACE_EVENT2("views", "views::OnPaintFocusBorder",
1098 "width", canvas->GetSkCanvas()->getDevice()->width(), 1098 "width", canvas->GetSkCanvas()->getDevice()->width(),
1099 "height", canvas->GetSkCanvas()->getDevice()->height()); 1099 "height", canvas->GetSkCanvas()->getDevice()->height());
1100 canvas->DrawFocusRect(GetLocalBounds()); 1100 canvas->DrawFocusRect(GetLocalBounds());
1101 } 1101 }
1102 } 1102 }
1103 1103
1104 // Accelerated Painting -------------------------------------------------------- 1104 // Accelerated Painting --------------------------------------------------------
1105 1105
1106 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { 1106 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) {
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 2038
2039 OSExchangeData data; 2039 OSExchangeData data;
2040 WriteDragData(press_pt, &data); 2040 WriteDragData(press_pt, &data);
2041 2041
2042 // Message the RootView to do the drag and drop. That way if we're removed 2042 // Message the RootView to do the drag and drop. That way if we're removed
2043 // the RootView can detect it and avoid calling us back. 2043 // the RootView can detect it and avoid calling us back.
2044 GetWidget()->RunShellDrag(this, data, drag_operations); 2044 GetWidget()->RunShellDrag(this, data, drag_operations);
2045 } 2045 }
2046 2046
2047 } // namespace views 2047 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698