diff options
Diffstat (limited to 'ui/views/controls/textfield/textfield.cc')
-rw-r--r-- | ui/views/controls/textfield/textfield.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index a0e6abb..dd2ccb3 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc @@ -35,22 +35,24 @@ namespace { // Default placeholder text color. const SkColor kDefaultPlaceholderTextColor = SK_ColorLTGRAY; -#if defined(OS_WIN) && !defined(USE_AURA) -bool UseNativeTextfieldViews() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); - return command_line->HasSwitch(switches::kEnableViewsTextfield); -} -#endif - } // namespace namespace views { +///////////////////////////////////////////////////////////////////////////// +// Textfield + // static const char Textfield::kViewClassName[] = "views/Textfield"; -///////////////////////////////////////////////////////////////////////////// -// Textfield +// static +bool Textfield::IsViewsTextfieldEnabled() { +#if defined(OS_WIN) && !defined(USE_AURA) + return CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableViewsTextfield); +#endif + return true; +} Textfield::Textfield() : native_wrapper_(NULL), @@ -480,7 +482,7 @@ void Textfield::ViewHierarchyChanged(bool is_add, View* parent, View* child) { // initialization for the wrapper. // // Remove the include for native_textfield_win.h above when you fix this. - if (!UseNativeTextfieldViews()) + if (!IsViewsTextfieldEnabled()) static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); #endif } @@ -497,7 +499,7 @@ std::string Textfield::GetClassName() const { NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( Textfield* field) { #if defined(OS_WIN) && !defined(USE_AURA) - if (!UseNativeTextfieldViews()) + if (!Textfield::IsViewsTextfieldEnabled()) return new NativeTextfieldWin(field); #endif return new NativeTextfieldViews(field); |