| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 void InitTextfields(Textfield::StyleFlags style, int count) { | 155 void InitTextfields(Textfield::StyleFlags style, int count) { |
| 156 // Append kEnableViewsTextfield to use NativeTextfieldViews on Windows. | 156 // Append kEnableViewsTextfield to use NativeTextfieldViews on Windows. |
| 157 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 157 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 158 command_line->AppendSwitch(switches::kEnableViewsTextfield); | 158 command_line->AppendSwitch(switches::kEnableViewsTextfield); |
| 159 | 159 |
| 160 ASSERT_FALSE(textfield_); | 160 ASSERT_FALSE(textfield_); |
| 161 textfield_ = new TestTextfield(style); | 161 textfield_ = new TestTextfield(style); |
| 162 textfield_->SetController(this); | 162 textfield_->SetController(this); |
| 163 widget_ = new Widget; | 163 widget_ = new Widget; |
| 164 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); | 164 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); |
| 165 params.bounds = gfx::Rect(100, 100, 100, 100); | 165 params.bounds = gfx::Rect(100, 100, 100, 100); |
| 166 widget_->Init(params); | 166 widget_->Init(params); |
| 167 View* container = new View(); | 167 View* container = new View(); |
| 168 widget_->SetContentsView(container); | 168 widget_->SetContentsView(container); |
| 169 container->AddChildView(textfield_); | 169 container->AddChildView(textfield_); |
| 170 | 170 |
| 171 textfield_view_ = static_cast<NativeTextfieldViews*>( | 171 textfield_view_ = static_cast<NativeTextfieldViews*>( |
| 172 textfield_->GetNativeWrapperForTesting()); | 172 textfield_->GetNativeWrapperForTesting()); |
| 173 textfield_view_->SetBoundsRect(params.bounds); | 173 textfield_view_->SetBoundsRect(params.bounds); |
| 174 textfield_->set_id(1); | 174 textfield_->set_id(1); |
| (...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1677 EXPECT_EQ(char_rect[i], actual_rect) << " i=" << i; | 1677 EXPECT_EQ(char_rect[i], actual_rect) << " i=" << i; |
| 1678 } | 1678 } |
| 1679 | 1679 |
| 1680 // Return false if the index is out of range. | 1680 // Return false if the index is out of range. |
| 1681 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count, &rect)); | 1681 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count, &rect)); |
| 1682 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 1, &rect)); | 1682 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 1, &rect)); |
| 1683 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 100, &rect)); | 1683 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 100, &rect)); |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 } // namespace views | 1686 } // namespace views |
| OLD | NEW |