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/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const char Textfield::kViewClassName[] = "views/Textfield"; | 49 const char Textfield::kViewClassName[] = "views/Textfield"; |
50 | 50 |
51 // static | 51 // static |
52 bool Textfield::IsViewsTextfieldEnabled() { | 52 bool Textfield::IsViewsTextfieldEnabled() { |
53 #if defined(OS_WIN) && !defined(USE_AURA) | 53 #if defined(OS_WIN) && !defined(USE_AURA) |
54 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 54 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
55 if (command_line->HasSwitch(switches::kDisableViewsTextfield)) | 55 if (command_line->HasSwitch(switches::kDisableViewsTextfield)) |
56 return false; | 56 return false; |
57 if (command_line->HasSwitch(switches::kEnableViewsTextfield)) | 57 if (command_line->HasSwitch(switches::kEnableViewsTextfield)) |
58 return true; | 58 return true; |
59 return false; | |
60 #endif | 59 #endif |
61 return true; | 60 return true; |
62 } | 61 } |
63 | 62 |
64 Textfield::Textfield() | 63 Textfield::Textfield() |
65 : native_wrapper_(NULL), | 64 : native_wrapper_(NULL), |
66 controller_(NULL), | 65 controller_(NULL), |
67 style_(STYLE_DEFAULT), | 66 style_(STYLE_DEFAULT), |
68 read_only_(false), | 67 read_only_(false), |
69 default_width_in_chars_(0), | 68 default_width_in_chars_(0), |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 605 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
607 Textfield* field) { | 606 Textfield* field) { |
608 #if defined(OS_WIN) && !defined(USE_AURA) | 607 #if defined(OS_WIN) && !defined(USE_AURA) |
609 if (!Textfield::IsViewsTextfieldEnabled()) | 608 if (!Textfield::IsViewsTextfieldEnabled()) |
610 return new NativeTextfieldWin(field); | 609 return new NativeTextfieldWin(field); |
611 #endif | 610 #endif |
612 return new NativeTextfieldViews(field); | 611 return new NativeTextfieldViews(field); |
613 } | 612 } |
614 | 613 |
615 } // namespace views | 614 } // namespace views |
OLD | NEW |