| Index: chrome/browser/ui/views/omnibox/omnibox_views.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/omnibox/omnibox_views.cc (revision 144960)
|
| +++ chrome/browser/ui/views/omnibox/omnibox_views.cc (working copy)
|
| @@ -13,6 +13,25 @@
|
| #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h"
|
| #endif
|
|
|
| +bool UseOmniboxViews() {
|
| +#if defined(OS_WIN) && !defined(USE_AURA)
|
| + static bool kUseOmniboxViews = CommandLine::ForCurrentProcess()->
|
| + HasSwitch(switches::kEnableViewsTextfield);
|
| + return kUseOmniboxViews;
|
| +#endif
|
| + return true;
|
| +}
|
| +
|
| +OmniboxViewViews* GetOmniboxViewViews(OmniboxView* view) {
|
| + return UseOmniboxViews() ? static_cast<OmniboxViewViews*>(view) : NULL;
|
| +}
|
| +
|
| +#if defined(OS_WIN) && !defined(USE_AURA)
|
| +OmniboxViewWin* GetOmniboxViewWin(OmniboxView* view) {
|
| + return UseOmniboxViews() ? NULL : static_cast<OmniboxViewWin*>(view);
|
| +}
|
| +#endif
|
| +
|
| OmniboxView* CreateOmniboxView(AutocompleteEditController* controller,
|
| ToolbarModel* toolbar_model,
|
| Profile* profile,
|
| @@ -20,8 +39,7 @@
|
| bool popup_window_mode,
|
| LocationBarView* location_bar) {
|
| #if defined(OS_WIN) && !defined(USE_AURA)
|
| - CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| - if (!command_line->HasSwitch(switches::kEnableViewsTextfield))
|
| + if (!UseOmniboxViews())
|
| return new OmniboxViewWin(controller, toolbar_model, location_bar,
|
| command_updater, popup_window_mode, location_bar);
|
| #endif
|
|
|