summaryrefslogtreecommitdiffstats
path: root/views/widget/root_view.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 23:50:55 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 23:50:55 +0000
commit0d52b23006174f37ba0337c170506b9580ccaf29 (patch)
tree889e57066b28a69e288132c72d0dc560cf5e2051 /views/widget/root_view.cc
parent1bdf29eb27c00bd1be0a6f3eb65d33ecddde274f (diff)
downloadchromium_src-0d52b23006174f37ba0337c170506b9580ccaf29.zip
chromium_src-0d52b23006174f37ba0337c170506b9580ccaf29.tar.gz
chromium_src-0d52b23006174f37ba0337c170506b9580ccaf29.tar.bz2
Removing floating views, they are not used anymore.
BUG=None TEST=Run unit_tests, ui_tests, interactive ui_tests. Make sure focus traversal still works. Review URL: http://codereview.chromium.org/113215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/root_view.cc')
-rw-r--r--views/widget/root_view.cc104
1 files changed, 14 insertions, 90 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index fd9f1c0..bc012c8 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -657,56 +657,19 @@ View* RootView::FindNextFocusableViewImpl(View* starting_view,
// First let's try the left child.
if (can_go_down) {
- View* v = NULL;
if (starting_view->GetChildViewCount() > 0) {
- // We are only interested in non floating-views, as attached floating
- // views order is variable (depending on mouse moves).
- for (int i = 0; i < starting_view->GetChildViewCount(); i++) {
- View* child = starting_view->GetChildViewAt(i);
- if (!child->IsFloatingView()) {
- v = FindNextFocusableViewImpl(child, false, false, true,
- skip_group_id);
- break;
- }
- }
- }
- if (v == NULL) {
- // Try the floating views.
- int id = 0;
- if (starting_view->EnumerateFloatingViews(View::FIRST, 0, &id)) {
- View* child = starting_view->RetrieveFloatingViewForID(id);
- DCHECK(child);
- v = FindNextFocusableViewImpl(child, false, false, true, skip_group_id);
- }
+ View* v = FindNextFocusableViewImpl(starting_view->GetChildViewAt(0),
+ false, false, true, skip_group_id);
+ if (v)
+ return v;
}
- if (v)
- return v;
}
// Then try the right sibling.
- View* sibling = NULL;
- if (starting_view->IsFloatingView()) {
- int id = 0;
- if (starting_view->GetParent()->EnumerateFloatingViews(
- View::NEXT, starting_view->GetFloatingViewID(), &id)) {
- sibling = starting_view->GetParent()->RetrieveFloatingViewForID(id);
- DCHECK(sibling);
- }
- } else {
- sibling = starting_view->GetNextFocusableView();
- if (!sibling) {
- // Let's try floating views.
- int id = 0;
- if (starting_view->GetParent()->EnumerateFloatingViews(View::FIRST,
- 0, &id)) {
- sibling = starting_view->GetParent()->RetrieveFloatingViewForID(id);
- DCHECK(sibling);
- }
- }
- }
+ View* sibling = starting_view->GetNextFocusableView();
if (sibling) {
- View* v =
- FindNextFocusableViewImpl(sibling, false, false, true, skip_group_id);
+ View* v = FindNextFocusableViewImpl(sibling,
+ false, false, true, skip_group_id);
if (v)
return v;
}
@@ -715,15 +678,7 @@ View* RootView::FindNextFocusableViewImpl(View* starting_view,
if (can_go_up) {
View* parent = starting_view->GetParent();
while (parent) {
- int id = 0;
- if (parent->IsFloatingView() &&
- parent->GetParent()->EnumerateFloatingViews(
- View::NEXT, parent->GetFloatingViewID(), &id)) {
- sibling = parent->GetParent()->RetrieveFloatingViewForID(id);
- DCHECK(sibling);
- } else {
- sibling = parent->GetNextFocusableView();
- }
+ sibling = parent->GetNextFocusableView();
if (sibling) {
return FindNextFocusableViewImpl(sibling,
false, true, true,
@@ -750,24 +705,14 @@ View* RootView::FindPreviousFocusableViewImpl(View* starting_view,
int skip_group_id) {
// Let's go down and right as much as we can.
if (can_go_down) {
- View* v = NULL;
- if (starting_view->GetChildViewCount() -
- starting_view->GetFloatingViewCount() > 0) {
+ if (starting_view->GetChildViewCount() > 0) {
View* view =
starting_view->GetChildViewAt(starting_view->GetChildViewCount() - 1);
- v = FindPreviousFocusableViewImpl(view, false, false, true,
- skip_group_id);
- } else {
- // Let's try floating views.
- int id = 0;
- if (starting_view->EnumerateFloatingViews(View::LAST, 0, &id)) {
- View* child = starting_view->RetrieveFloatingViewForID(id);
- DCHECK(child);
- v = FindNextFocusableViewImpl(child, false, false, true, skip_group_id);
- }
+ View* v = FindPreviousFocusableViewImpl(view, false, false, true,
+ skip_group_id);
+ if (v)
+ return v;
}
- if (v)
- return v;
}
if (!skip_starting_view) {
@@ -778,28 +723,7 @@ View* RootView::FindPreviousFocusableViewImpl(View* starting_view,
}
// Then try the left sibling.
- View* sibling = NULL;
- if (starting_view->IsFloatingView()) {
- int id = 0;
- if (starting_view->GetParent()->EnumerateFloatingViews(
- View::PREVIOUS, starting_view->GetFloatingViewID(), &id)) {
- sibling = starting_view->GetParent()->RetrieveFloatingViewForID(id);
- DCHECK(sibling);
- }
- if (!sibling) {
- // No more floating views, try regular views, starting at the last one.
- View* parent = starting_view->GetParent();
- for (int i = parent->GetChildViewCount() - 1; i >= 0; i--) {
- View* v = parent->GetChildViewAt(i);
- if (!v->IsFloatingView()) {
- sibling = v;
- break;
- }
- }
- }
- } else {
- sibling = starting_view->GetPreviousFocusableView();
- }
+ View* sibling = starting_view->GetPreviousFocusableView();
if (sibling) {
return FindPreviousFocusableViewImpl(sibling,
false, true, true,