Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 14049016: Enable new dialog style transparency with Views Textfields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // The new dialog style cannot host native Windows textfield controls.
60 if (command_line->HasSwitch(switches::kEnableNewDialogStyle))
61 return true;
59 #endif 62 #endif
60 return true; 63 return true;
61 } 64 }
62 65
63 Textfield::Textfield() 66 Textfield::Textfield()
64 : native_wrapper_(NULL), 67 : native_wrapper_(NULL),
65 controller_(NULL), 68 controller_(NULL),
66 style_(STYLE_DEFAULT), 69 style_(STYLE_DEFAULT),
67 read_only_(false), 70 read_only_(false),
68 default_width_in_chars_(0), 71 default_width_in_chars_(0),
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 600 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
598 Textfield* field) { 601 Textfield* field) {
599 #if defined(OS_WIN) && !defined(USE_AURA) 602 #if defined(OS_WIN) && !defined(USE_AURA)
600 if (!Textfield::IsViewsTextfieldEnabled()) 603 if (!Textfield::IsViewsTextfieldEnabled())
601 return new NativeTextfieldWin(field); 604 return new NativeTextfieldWin(field);
602 #endif 605 #endif
603 return new NativeTextfieldViews(field); 606 return new NativeTextfieldViews(field);
604 } 607 }
605 608
606 } // namespace views 609 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698