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" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 kRidiculeLinkID, kClosetLinkID, kVisitingLinkID, kAmelieLinkID, | 449 kRidiculeLinkID, kClosetLinkID, kVisitingLinkID, kAmelieLinkID, |
450 kJoyeuxNoelLinkID, kCampingLinkID, kBriceDeNiceLinkID, | 450 kJoyeuxNoelLinkID, kCampingLinkID, kBriceDeNiceLinkID, |
451 kTaxiLinkID, kAsterixLinkID | 451 kTaxiLinkID, kAsterixLinkID |
452 }; | 452 }; |
453 | 453 |
454 DCHECK(arraysize(kTitles) == arraysize(kIDs)); | 454 DCHECK(arraysize(kTitles) == arraysize(kIDs)); |
455 | 455 |
456 y = 5; | 456 y = 5; |
457 for (size_t i = 0; i < arraysize(kTitles); ++i) { | 457 for (size_t i = 0; i < arraysize(kTitles); ++i) { |
458 Link* link = new Link(ASCIIToUTF16(kTitles[i])); | 458 Link* link = new Link(ASCIIToUTF16(kTitles[i])); |
459 link->SetHorizontalAlignment(Label::ALIGN_LEFT); | 459 link->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
460 link->set_id(kIDs[i]); | 460 link->set_id(kIDs[i]); |
461 scroll_content->AddChildView(link); | 461 scroll_content->AddChildView(link); |
462 link->SetBounds(5, y, 300, 15); | 462 link->SetBounds(5, y, 300, 15); |
463 y += 15; | 463 y += 15; |
464 } | 464 } |
465 | 465 |
466 y = 250; | 466 y = 250; |
467 int width = 60; | 467 int width = 60; |
468 button = new NativeTextButton(NULL, ASCIIToUTF16("OK")); | 468 button = new NativeTextButton(NULL, ASCIIToUTF16("OK")); |
469 button->set_id(kOKButtonID); | 469 button->set_id(kOKButtonID); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 contents->AddChildView(text_field); | 531 contents->AddChildView(text_field); |
532 text_field->SetBounds(10, 10, 100, 20); | 532 text_field->SetBounds(10, 10, 100, 20); |
533 text_field->set_id(kSearchTextfieldID); | 533 text_field->set_id(kSearchTextfieldID); |
534 | 534 |
535 button = new NativeTextButton(NULL, ASCIIToUTF16("Search")); | 535 button = new NativeTextButton(NULL, ASCIIToUTF16("Search")); |
536 contents->AddChildView(button); | 536 contents->AddChildView(button); |
537 button->SetBounds(112, 5, 60, 30); | 537 button->SetBounds(112, 5, 60, 30); |
538 button->set_id(kSearchButtonID); | 538 button->set_id(kSearchButtonID); |
539 | 539 |
540 link = new Link(ASCIIToUTF16("Help")); | 540 link = new Link(ASCIIToUTF16("Help")); |
541 link->SetHorizontalAlignment(Label::ALIGN_LEFT); | 541 link->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
542 link->set_id(kHelpLinkID); | 542 link->set_id(kHelpLinkID); |
543 contents->AddChildView(link); | 543 contents->AddChildView(link); |
544 link->SetBounds(175, 10, 30, 20); | 544 link->SetBounds(175, 10, 30, 20); |
545 | 545 |
546 search_border_view_ = new BorderView(contents); | 546 search_border_view_ = new BorderView(contents); |
547 search_border_view_->set_id(kSearchContainerID); | 547 search_border_view_->set_id(kSearchContainerID); |
548 | 548 |
549 GetContentsView()->AddChildView(search_border_view_); | 549 GetContentsView()->AddChildView(search_border_view_); |
550 search_border_view_->SetBounds(300, y, 240, 50); | 550 search_border_view_->SetBounds(300, y, 240, 50); |
551 | 551 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 GetFocusManager()->AdvanceFocus(true); | 801 GetFocusManager()->AdvanceFocus(true); |
802 View* focused_view = GetFocusManager()->GetFocusedView(); | 802 View* focused_view = GetFocusManager()->GetFocusedView(); |
803 EXPECT_TRUE(focused_view != NULL); | 803 EXPECT_TRUE(focused_view != NULL); |
804 if (focused_view) | 804 if (focused_view) |
805 EXPECT_EQ(kRightTraversalIDs[j], focused_view->id()); | 805 EXPECT_EQ(kRightTraversalIDs[j], focused_view->id()); |
806 } | 806 } |
807 } | 807 } |
808 } | 808 } |
809 | 809 |
810 } // namespace views | 810 } // namespace views |
OLD | NEW |