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/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 28 matching lines...) Expand all Loading... |
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 // Overridden from views::WidgetDelegate: |
49 views::View* GetContentsView() override { return this; } | |
50 | |
51 void FocusOnTextInput() { GetFocusManager()->SetFocusedView(text_field_); } | 49 void FocusOnTextInput() { GetFocusManager()->SetFocusedView(text_field_); } |
52 | 50 |
53 private: | 51 private: |
54 views::Textfield* text_field_; // owned by views hierarchy | 52 views::Textfield* text_field_; // owned by views hierarchy |
55 | 53 |
56 DISALLOW_COPY_AND_ASSIGN(TextInputView); | 54 DISALLOW_COPY_AND_ASSIGN(TextInputView); |
57 }; | 55 }; |
58 | 56 |
59 } // namespace | 57 } // namespace |
60 | 58 |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 UpdateDisplay("500x500"); | 706 UpdateDisplay("500x500"); |
709 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 707 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
710 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 708 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
711 | 709 |
712 GetMagnificationController()->SetEnabled(false); | 710 GetMagnificationController()->SetEnabled(false); |
713 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 711 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
714 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 712 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
715 } | 713 } |
716 | 714 |
717 } // namespace ash | 715 } // namespace ash |
OLD | NEW |