OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
6 | 6 |
7 #include "ash/common/accessibility_types.h" | 7 #include "ash/common/accessibility_types.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 AddChildView(text_field_); | 38 AddChildView(text_field_); |
39 SetLayoutManager(new views::FillLayout); | 39 SetLayoutManager(new views::FillLayout); |
40 } | 40 } |
41 | 41 |
42 ~TextInputView() override {} | 42 ~TextInputView() override {} |
43 | 43 |
44 gfx::Size GetPreferredSize() const override { | 44 gfx::Size GetPreferredSize() const override { |
45 return gfx::Size(kTextInputWindowWidth, kTextInputWindowHeight); | 45 return gfx::Size(kTextInputWindowWidth, kTextInputWindowHeight); |
46 } | 46 } |
47 | 47 |
48 // Overridden from views::WidgetDelegate: | 48 void FocusOnTextInput() { text_field_->RequestFocus(); } |
49 void FocusOnTextInput() { GetFocusManager()->SetFocusedView(text_field_); } | |
50 | 49 |
51 private: | 50 private: |
52 views::Textfield* text_field_; // owned by views hierarchy | 51 views::Textfield* text_field_; // owned by views hierarchy |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(TextInputView); | 53 DISALLOW_COPY_AND_ASSIGN(TextInputView); |
55 }; | 54 }; |
56 | 55 |
57 } // namespace | 56 } // namespace |
58 | 57 |
59 class MagnificationControllerTest : public test::AshTestBase { | 58 class MagnificationControllerTest : public test::AshTestBase { |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 UpdateDisplay("500x500"); | 694 UpdateDisplay("500x500"); |
696 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 695 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
697 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 696 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
698 | 697 |
699 GetMagnificationController()->SetEnabled(false); | 698 GetMagnificationController()->SetEnabled(false); |
700 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 699 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
701 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 700 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
702 } | 701 } |
703 | 702 |
704 } // namespace ash | 703 } // namespace ash |
OLD | NEW |