| OLD | NEW |
| 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/focus/focus_manager.h" | 5 #include "ui/views/focus/focus_manager.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "ui/base/models/combobox_model.h" | 9 #include "ui/base/models/combobox_model.h" |
| 10 #include "ui/views/controls/button/checkbox.h" | 10 #include "ui/views/controls/button/checkbox.h" |
| 11 #include "ui/views/controls/button/radio_button.h" | 11 #include "ui/views/controls/button/radio_button.h" |
| 12 #include "ui/views/controls/button/text_button.h" | 12 #include "ui/views/controls/button/text_button.h" |
| 13 #include "ui/views/controls/combobox/combobox.h" | 13 #include "ui/views/controls/combobox/combobox.h" |
| 14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
| 15 #include "ui/views/controls/link.h" | 15 #include "ui/views/controls/link.h" |
| 16 #include "ui/views/controls/native/native_view_host.h" | 16 #include "ui/views/controls/native/native_view_host.h" |
| 17 #include "ui/views/controls/scroll_view.h" | 17 #include "ui/views/controls/scroll_view.h" |
| 18 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
| 18 #include "ui/views/controls/textfield/textfield.h" | 19 #include "ui/views/controls/textfield/textfield.h" |
| 19 #include "ui/views/focus/focus_manager_test.h" | 20 #include "ui/views/focus/focus_manager_test.h" |
| 20 #include "ui/views/widget/root_view.h" | 21 #include "ui/views/widget/root_view.h" |
| 21 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 22 | 23 |
| 23 #if !defined(USE_AURA) | |
| 24 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | |
| 25 #endif | |
| 26 | |
| 27 namespace views { | 24 namespace views { |
| 28 | 25 |
| 29 namespace { | 26 namespace { |
| 30 | 27 |
| 31 int count = 1; | 28 int count = 1; |
| 32 | 29 |
| 33 const int kTopCheckBoxID = count++; // 1 | 30 const int kTopCheckBoxID = count++; // 1 |
| 34 const int kLeftContainerID = count++; | 31 const int kLeftContainerID = count++; |
| 35 const int kAppleLabelID = count++; | 32 const int kAppleLabelID = count++; |
| 36 const int kAppleTextfieldID = count++; | 33 const int kAppleTextfieldID = count++; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 61 const int kJoyeuxNoelLinkID = count++; | 58 const int kJoyeuxNoelLinkID = count++; |
| 62 const int kCampingLinkID = count++; | 59 const int kCampingLinkID = count++; |
| 63 const int kBriceDeNiceLinkID = count++; | 60 const int kBriceDeNiceLinkID = count++; |
| 64 const int kTaxiLinkID = count++; // 30 | 61 const int kTaxiLinkID = count++; // 30 |
| 65 const int kAsterixLinkID = count++; | 62 const int kAsterixLinkID = count++; |
| 66 | 63 |
| 67 const int kOKButtonID = count++; | 64 const int kOKButtonID = count++; |
| 68 const int kCancelButtonID = count++; | 65 const int kCancelButtonID = count++; |
| 69 const int kHelpButtonID = count++; | 66 const int kHelpButtonID = count++; |
| 70 | 67 |
| 71 #if !defined(USE_AURA) | |
| 72 const int kStyleContainerID = count++; // 35 | 68 const int kStyleContainerID = count++; // 35 |
| 73 const int kBoldCheckBoxID = count++; | 69 const int kBoldCheckBoxID = count++; |
| 74 const int kItalicCheckBoxID = count++; | 70 const int kItalicCheckBoxID = count++; |
| 75 const int kUnderlinedCheckBoxID = count++; | 71 const int kUnderlinedCheckBoxID = count++; |
| 76 const int kStyleHelpLinkID = count++; | 72 const int kStyleHelpLinkID = count++; |
| 77 const int kStyleTextEditID = count++; // 40 | 73 const int kStyleTextEditID = count++; // 40 |
| 78 #endif | |
| 79 | 74 |
| 80 const int kSearchContainerID = count++; | 75 const int kSearchContainerID = count++; |
| 81 const int kSearchTextfieldID = count++; | 76 const int kSearchTextfieldID = count++; |
| 82 const int kSearchButtonID = count++; | 77 const int kSearchButtonID = count++; |
| 83 const int kHelpLinkID = count++; | 78 const int kHelpLinkID = count++; |
| 84 | 79 |
| 85 const int kThumbnailContainerID = count++; // 45 | 80 const int kThumbnailContainerID = count++; // 45 |
| 86 const int kThumbnailStarID = count++; | 81 const int kThumbnailStarID = count++; |
| 87 const int kThumbnailSuperStarID = count++; | 82 const int kThumbnailSuperStarID = count++; |
| 88 | 83 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 187 |
| 193 virtual void InitContentView() OVERRIDE; | 188 virtual void InitContentView() OVERRIDE; |
| 194 | 189 |
| 195 protected: | 190 protected: |
| 196 FocusTraversalTest(); | 191 FocusTraversalTest(); |
| 197 | 192 |
| 198 View* FindViewByID(int id) { | 193 View* FindViewByID(int id) { |
| 199 View* view = GetContentsView()->GetViewByID(id); | 194 View* view = GetContentsView()->GetViewByID(id); |
| 200 if (view) | 195 if (view) |
| 201 return view; | 196 return view; |
| 202 #if !defined(USE_AURA) | |
| 203 if (style_tab_) | 197 if (style_tab_) |
| 204 view = style_tab_->GetSelectedTab()->GetViewByID(id); | 198 view = style_tab_->GetSelectedTab()->GetViewByID(id); |
| 205 #endif | |
| 206 if (view) | 199 if (view) |
| 207 return view; | 200 return view; |
| 208 view = search_border_view_->GetContentsRootView()->GetViewByID(id); | 201 view = search_border_view_->GetContentsRootView()->GetViewByID(id); |
| 209 if (view) | 202 if (view) |
| 210 return view; | 203 return view; |
| 211 return NULL; | 204 return NULL; |
| 212 } | 205 } |
| 213 | 206 |
| 214 protected: | 207 protected: |
| 215 #if !defined(USE_AURA) | |
| 216 TabbedPane* style_tab_; | 208 TabbedPane* style_tab_; |
| 217 #endif | |
| 218 BorderView* search_border_view_; | 209 BorderView* search_border_view_; |
| 219 DummyComboboxModel combobox_model_; | 210 DummyComboboxModel combobox_model_; |
| 220 PaneView* left_container_; | 211 PaneView* left_container_; |
| 221 PaneView* right_container_; | 212 PaneView* right_container_; |
| 222 | 213 |
| 223 DISALLOW_COPY_AND_ASSIGN(FocusTraversalTest); | 214 DISALLOW_COPY_AND_ASSIGN(FocusTraversalTest); |
| 224 }; | 215 }; |
| 225 | 216 |
| 226 FocusTraversalTest::FocusTraversalTest() | 217 FocusTraversalTest::FocusTraversalTest() |
| 227 : | 218 : style_tab_(NULL), |
| 228 #if !defined(USE_AURA) | |
| 229 style_tab_(NULL), | |
| 230 #endif | |
| 231 search_border_view_(NULL) { | 219 search_border_view_(NULL) { |
| 232 } | 220 } |
| 233 | 221 |
| 234 FocusTraversalTest::~FocusTraversalTest() { | 222 FocusTraversalTest::~FocusTraversalTest() { |
| 235 } | 223 } |
| 236 | 224 |
| 237 void FocusTraversalTest::InitContentView() { | 225 void FocusTraversalTest::InitContentView() { |
| 238 // Create a complicated view hierarchy with lots of control types for | 226 // Create a complicated view hierarchy with lots of control types for |
| 239 // use by all of the focus traversal tests. | 227 // use by all of the focus traversal tests. |
| 240 // | 228 // |
| (...skipping 28 matching lines...) Expand all Loading... |
| 269 // Link * kVisitingLinkID | 257 // Link * kVisitingLinkID |
| 270 // Link * kAmelieLinkID | 258 // Link * kAmelieLinkID |
| 271 // Link * kJoyeuxNoelLinkID | 259 // Link * kJoyeuxNoelLinkID |
| 272 // Link * kCampingLinkID | 260 // Link * kCampingLinkID |
| 273 // Link * kBriceDeNiceLinkID | 261 // Link * kBriceDeNiceLinkID |
| 274 // Link * kTaxiLinkID | 262 // Link * kTaxiLinkID |
| 275 // Link * kAsterixLinkID | 263 // Link * kAsterixLinkID |
| 276 // NativeButton * kOKButtonID | 264 // NativeButton * kOKButtonID |
| 277 // NativeButton * kCancelButtonID | 265 // NativeButton * kCancelButtonID |
| 278 // NativeButton * kHelpButtonID | 266 // NativeButton * kHelpButtonID |
| 279 // #if !defined(USE_AURA) | |
| 280 // TabbedPane * kStyleContainerID | 267 // TabbedPane * kStyleContainerID |
| 281 // View | 268 // View |
| 282 // Checkbox * kBoldCheckBoxID | 269 // Checkbox * kBoldCheckBoxID |
| 283 // Checkbox * kItalicCheckBoxID | 270 // Checkbox * kItalicCheckBoxID |
| 284 // Checkbox * kUnderlinedCheckBoxID | 271 // Checkbox * kUnderlinedCheckBoxID |
| 285 // Link * kStyleHelpLinkID | 272 // Link * kStyleHelpLinkID |
| 286 // Textfield * kStyleTextEditID | 273 // Textfield * kStyleTextEditID |
| 287 // Other | 274 // Other |
| 288 // #endif | |
| 289 // BorderView kSearchContainerID | 275 // BorderView kSearchContainerID |
| 290 // View | 276 // View |
| 291 // Textfield * kSearchTextfieldID | 277 // Textfield * kSearchTextfieldID |
| 292 // NativeButton * kSearchButtonID | 278 // NativeButton * kSearchButtonID |
| 293 // Link * kHelpLinkID | 279 // Link * kHelpLinkID |
| 294 // View * kThumbnailContainerID | 280 // View * kThumbnailContainerID |
| 295 // NativeButton * kThumbnailStarID | 281 // NativeButton * kThumbnailStarID |
| 296 // NativeButton * kThumbnailSuperStarID | 282 // NativeButton * kThumbnailSuperStarID |
| 297 | 283 |
| 298 GetContentsView()->set_background( | 284 GetContentsView()->set_background( |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 button = new NativeTextButton(NULL, ASCIIToUTF16("Help")); | 468 button = new NativeTextButton(NULL, ASCIIToUTF16("Help")); |
| 483 button->set_id(kHelpButtonID); | 469 button->set_id(kHelpButtonID); |
| 484 GetContentsView()->AddChildView(button); | 470 GetContentsView()->AddChildView(button); |
| 485 button->SetBounds(290, y, width, 30); | 471 button->SetBounds(290, y, width, 30); |
| 486 | 472 |
| 487 y += 40; | 473 y += 40; |
| 488 | 474 |
| 489 View* contents = NULL; | 475 View* contents = NULL; |
| 490 Link* link = NULL; | 476 Link* link = NULL; |
| 491 | 477 |
| 492 #if !defined(USE_AURA) | |
| 493 // Left bottom box with style checkboxes. | 478 // Left bottom box with style checkboxes. |
| 494 contents = new View(); | 479 contents = new View(); |
| 495 contents->set_background(Background::CreateSolidBackground(SK_ColorWHITE)); | 480 contents->set_background(Background::CreateSolidBackground(SK_ColorWHITE)); |
| 496 cb = new Checkbox(ASCIIToUTF16("Bold")); | 481 cb = new Checkbox(ASCIIToUTF16("Bold")); |
| 497 contents->AddChildView(cb); | 482 contents->AddChildView(cb); |
| 498 cb->SetBounds(10, 10, 50, 20); | 483 cb->SetBounds(10, 10, 50, 20); |
| 499 cb->set_id(kBoldCheckBoxID); | 484 cb->set_id(kBoldCheckBoxID); |
| 500 | 485 |
| 501 cb = new Checkbox(ASCIIToUTF16("Italic")); | 486 cb = new Checkbox(ASCIIToUTF16("Italic")); |
| 502 contents->AddChildView(cb); | 487 contents->AddChildView(cb); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 517 contents->AddChildView(text_field); | 502 contents->AddChildView(text_field); |
| 518 text_field->SetBounds(10, 50, 100, 20); | 503 text_field->SetBounds(10, 50, 100, 20); |
| 519 text_field->set_id(kStyleTextEditID); | 504 text_field->set_id(kStyleTextEditID); |
| 520 | 505 |
| 521 style_tab_ = new TabbedPane(); | 506 style_tab_ = new TabbedPane(); |
| 522 style_tab_->set_id(kStyleContainerID); | 507 style_tab_->set_id(kStyleContainerID); |
| 523 GetContentsView()->AddChildView(style_tab_); | 508 GetContentsView()->AddChildView(style_tab_); |
| 524 style_tab_->SetBounds(10, y, 210, 100); | 509 style_tab_->SetBounds(10, y, 210, 100); |
| 525 style_tab_->AddTab(ASCIIToUTF16("Style"), contents); | 510 style_tab_->AddTab(ASCIIToUTF16("Style"), contents); |
| 526 style_tab_->AddTab(ASCIIToUTF16("Other"), new View()); | 511 style_tab_->AddTab(ASCIIToUTF16("Other"), new View()); |
| 527 #endif | |
| 528 | 512 |
| 529 // Right bottom box with search. | 513 // Right bottom box with search. |
| 530 contents = new View(); | 514 contents = new View(); |
| 531 contents->set_background(Background::CreateSolidBackground(SK_ColorWHITE)); | 515 contents->set_background(Background::CreateSolidBackground(SK_ColorWHITE)); |
| 532 text_field = new Textfield(); | 516 text_field = new Textfield(); |
| 533 contents->AddChildView(text_field); | 517 contents->AddChildView(text_field); |
| 534 text_field->SetBounds(10, 10, 100, 20); | 518 text_field->SetBounds(10, 10, 100, 20); |
| 535 text_field->set_id(kSearchTextfieldID); | 519 text_field->set_id(kSearchTextfieldID); |
| 536 | 520 |
| 537 button = new NativeTextButton(NULL, ASCIIToUTF16("Search")); | 521 button = new NativeTextButton(NULL, ASCIIToUTF16("Search")); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 558 } |
| 575 | 559 |
| 576 TEST_F(FocusTraversalTest, NormalTraversal) { | 560 TEST_F(FocusTraversalTest, NormalTraversal) { |
| 577 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextfieldID, | 561 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextfieldID, |
| 578 kOrangeTextfieldID, kBananaTextfieldID, kKiwiTextfieldID, | 562 kOrangeTextfieldID, kBananaTextfieldID, kKiwiTextfieldID, |
| 579 kFruitButtonID, kFruitCheckBoxID, kComboboxID, kBroccoliButtonID, | 563 kFruitButtonID, kFruitCheckBoxID, kComboboxID, kBroccoliButtonID, |
| 580 kRosettaLinkID, kStupeurEtTremblementLinkID, | 564 kRosettaLinkID, kStupeurEtTremblementLinkID, |
| 581 kDinerGameLinkID, kRidiculeLinkID, kClosetLinkID, kVisitingLinkID, | 565 kDinerGameLinkID, kRidiculeLinkID, kClosetLinkID, kVisitingLinkID, |
| 582 kAmelieLinkID, kJoyeuxNoelLinkID, kCampingLinkID, kBriceDeNiceLinkID, | 566 kAmelieLinkID, kJoyeuxNoelLinkID, kCampingLinkID, kBriceDeNiceLinkID, |
| 583 kTaxiLinkID, kAsterixLinkID, kOKButtonID, kCancelButtonID, kHelpButtonID, | 567 kTaxiLinkID, kAsterixLinkID, kOKButtonID, kCancelButtonID, kHelpButtonID, |
| 584 #if !defined(USE_AURA) | |
| 585 kStyleContainerID, kBoldCheckBoxID, kItalicCheckBoxID, | 568 kStyleContainerID, kBoldCheckBoxID, kItalicCheckBoxID, |
| 586 kUnderlinedCheckBoxID, kStyleHelpLinkID, kStyleTextEditID, | 569 kUnderlinedCheckBoxID, kStyleHelpLinkID, kStyleTextEditID, |
| 587 #endif | |
| 588 kSearchTextfieldID, kSearchButtonID, kHelpLinkID, | 570 kSearchTextfieldID, kSearchButtonID, kHelpLinkID, |
| 589 kThumbnailContainerID, kThumbnailStarID, kThumbnailSuperStarID }; | 571 kThumbnailContainerID, kThumbnailStarID, kThumbnailSuperStarID }; |
| 590 | 572 |
| 591 // Uncomment the following line if you want to test manually the UI of this | 573 // Uncomment the following line if you want to test manually the UI of this |
| 592 // test. | 574 // test. |
| 593 // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); | 575 // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); |
| 594 | 576 |
| 595 // Let's traverse the whole focus hierarchy (several times, to make sure it | 577 // Let's traverse the whole focus hierarchy (several times, to make sure it |
| 596 // loops OK). | 578 // loops OK). |
| 597 GetFocusManager()->ClearFocus(); | 579 GetFocusManager()->ClearFocus(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 615 if (focused_view) | 597 if (focused_view) |
| 616 EXPECT_EQ(kTraversalIDs[j], focused_view->id()); | 598 EXPECT_EQ(kTraversalIDs[j], focused_view->id()); |
| 617 } | 599 } |
| 618 } | 600 } |
| 619 } | 601 } |
| 620 | 602 |
| 621 TEST_F(FocusTraversalTest, TraversalWithNonEnabledViews) { | 603 TEST_F(FocusTraversalTest, TraversalWithNonEnabledViews) { |
| 622 const int kDisabledIDs[] = { | 604 const int kDisabledIDs[] = { |
| 623 kBananaTextfieldID, kFruitCheckBoxID, kComboboxID, kAsparagusButtonID, | 605 kBananaTextfieldID, kFruitCheckBoxID, kComboboxID, kAsparagusButtonID, |
| 624 kCauliflowerButtonID, kClosetLinkID, kVisitingLinkID, kBriceDeNiceLinkID, | 606 kCauliflowerButtonID, kClosetLinkID, kVisitingLinkID, kBriceDeNiceLinkID, |
| 625 kTaxiLinkID, kAsterixLinkID, kHelpButtonID, | 607 kTaxiLinkID, kAsterixLinkID, kHelpButtonID, kBoldCheckBoxID, |
| 626 #if !defined(USE_AURA) | |
| 627 kBoldCheckBoxID, | |
| 628 #endif | |
| 629 kSearchTextfieldID, kHelpLinkID }; | 608 kSearchTextfieldID, kHelpLinkID }; |
| 630 | 609 |
| 631 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextfieldID, | 610 const int kTraversalIDs[] = { kTopCheckBoxID, kAppleTextfieldID, |
| 632 kOrangeTextfieldID, kKiwiTextfieldID, kFruitButtonID, kBroccoliButtonID, | 611 kOrangeTextfieldID, kKiwiTextfieldID, kFruitButtonID, kBroccoliButtonID, |
| 633 kRosettaLinkID, kStupeurEtTremblementLinkID, kDinerGameLinkID, | 612 kRosettaLinkID, kStupeurEtTremblementLinkID, kDinerGameLinkID, |
| 634 kRidiculeLinkID, kAmelieLinkID, kJoyeuxNoelLinkID, kCampingLinkID, | 613 kRidiculeLinkID, kAmelieLinkID, kJoyeuxNoelLinkID, kCampingLinkID, |
| 635 kOKButtonID, kCancelButtonID, | 614 kOKButtonID, kCancelButtonID, kStyleContainerID, kItalicCheckBoxID, |
| 636 #if !defined(USE_AURA) | 615 kUnderlinedCheckBoxID, kStyleHelpLinkID, kStyleTextEditID, |
| 637 kStyleContainerID, kItalicCheckBoxID, kUnderlinedCheckBoxID, | |
| 638 kStyleHelpLinkID, kStyleTextEditID, | |
| 639 #endif | |
| 640 kSearchButtonID, kThumbnailContainerID, kThumbnailStarID, | 616 kSearchButtonID, kThumbnailContainerID, kThumbnailStarID, |
| 641 kThumbnailSuperStarID }; | 617 kThumbnailSuperStarID }; |
| 642 | 618 |
| 643 // Let's disable some views. | 619 // Let's disable some views. |
| 644 for (size_t i = 0; i < arraysize(kDisabledIDs); i++) { | 620 for (size_t i = 0; i < arraysize(kDisabledIDs); i++) { |
| 645 View* v = FindViewByID(kDisabledIDs[i]); | 621 View* v = FindViewByID(kDisabledIDs[i]); |
| 646 ASSERT_TRUE(v != NULL); | 622 ASSERT_TRUE(v != NULL); |
| 647 v->SetEnabled(false); | 623 v->SetEnabled(false); |
| 648 } | 624 } |
| 649 | 625 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 680 TEST_F(FocusTraversalTest, TraversalWithInvisibleViews) { | 656 TEST_F(FocusTraversalTest, TraversalWithInvisibleViews) { |
| 681 const int kInvisibleIDs[] = { kTopCheckBoxID, kOKButtonID, | 657 const int kInvisibleIDs[] = { kTopCheckBoxID, kOKButtonID, |
| 682 kThumbnailContainerID }; | 658 kThumbnailContainerID }; |
| 683 | 659 |
| 684 const int kTraversalIDs[] = { kAppleTextfieldID, kOrangeTextfieldID, | 660 const int kTraversalIDs[] = { kAppleTextfieldID, kOrangeTextfieldID, |
| 685 kBananaTextfieldID, kKiwiTextfieldID, kFruitButtonID, kFruitCheckBoxID, | 661 kBananaTextfieldID, kKiwiTextfieldID, kFruitButtonID, kFruitCheckBoxID, |
| 686 kComboboxID, kBroccoliButtonID, kRosettaLinkID, | 662 kComboboxID, kBroccoliButtonID, kRosettaLinkID, |
| 687 kStupeurEtTremblementLinkID, kDinerGameLinkID, kRidiculeLinkID, | 663 kStupeurEtTremblementLinkID, kDinerGameLinkID, kRidiculeLinkID, |
| 688 kClosetLinkID, kVisitingLinkID, kAmelieLinkID, kJoyeuxNoelLinkID, | 664 kClosetLinkID, kVisitingLinkID, kAmelieLinkID, kJoyeuxNoelLinkID, |
| 689 kCampingLinkID, kBriceDeNiceLinkID, kTaxiLinkID, kAsterixLinkID, | 665 kCampingLinkID, kBriceDeNiceLinkID, kTaxiLinkID, kAsterixLinkID, |
| 690 kCancelButtonID, kHelpButtonID, | 666 kCancelButtonID, kHelpButtonID, kStyleContainerID, kBoldCheckBoxID, |
| 691 #if !defined(USE_AURA) | 667 kItalicCheckBoxID, kUnderlinedCheckBoxID, kStyleHelpLinkID, |
| 692 kStyleContainerID, kBoldCheckBoxID, kItalicCheckBoxID, | 668 kStyleTextEditID, kSearchTextfieldID, kSearchButtonID, kHelpLinkID }; |
| 693 kUnderlinedCheckBoxID, kStyleHelpLinkID, kStyleTextEditID, | |
| 694 #endif | |
| 695 kSearchTextfieldID, kSearchButtonID, kHelpLinkID }; | |
| 696 | 669 |
| 697 | 670 |
| 698 // Let's make some views invisible. | 671 // Let's make some views invisible. |
| 699 for (size_t i = 0; i < arraysize(kInvisibleIDs); i++) { | 672 for (size_t i = 0; i < arraysize(kInvisibleIDs); i++) { |
| 700 View* v = FindViewByID(kInvisibleIDs[i]); | 673 View* v = FindViewByID(kInvisibleIDs[i]); |
| 701 ASSERT_TRUE(v != NULL); | 674 ASSERT_TRUE(v != NULL); |
| 702 v->SetVisible(false); | 675 v->SetVisible(false); |
| 703 } | 676 } |
| 704 | 677 |
| 705 // Uncomment the following line if you want to test manually the UI of this | 678 // Uncomment the following line if you want to test manually the UI of this |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 GetFocusManager()->AdvanceFocus(true); | 776 GetFocusManager()->AdvanceFocus(true); |
| 804 View* focused_view = GetFocusManager()->GetFocusedView(); | 777 View* focused_view = GetFocusManager()->GetFocusedView(); |
| 805 EXPECT_TRUE(focused_view != NULL); | 778 EXPECT_TRUE(focused_view != NULL); |
| 806 if (focused_view) | 779 if (focused_view) |
| 807 EXPECT_EQ(kRightTraversalIDs[j], focused_view->id()); | 780 EXPECT_EQ(kRightTraversalIDs[j], focused_view->id()); |
| 808 } | 781 } |
| 809 } | 782 } |
| 810 } | 783 } |
| 811 | 784 |
| 812 } // namespace views | 785 } // namespace views |
| OLD | NEW |