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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/omnibox/omnibox_views.h"
7 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
9 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
10 #include "ui/views/controls/textfield/textfield.h"
12 #if defined(OS_WIN) && !defined(USE_AURA)
13 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h"
16 OmniboxViewViews* GetOmniboxViewViews(OmniboxView* view) {
17 return views::Textfield::IsViewsTextfieldEnabled() ?
18 static_cast<OmniboxViewViews*>(view) : NULL;
21 OmniboxViewWin* GetOmniboxViewWin(OmniboxView* view) {
22 #if defined(OS_WIN) && !defined(USE_AURA)
23 return views::Textfield::IsViewsTextfieldEnabled() ?
24 NULL : static_cast<OmniboxViewWin*>(view);
30 OmniboxView* CreateOmniboxView(OmniboxEditController* controller,
32 CommandUpdater* command_updater,
33 bool popup_window_mode,
34 LocationBarView* location_bar,
35 const gfx::FontList& font_list) {
36 #if defined(OS_WIN) && !defined(USE_AURA)
37 if (!views::Textfield::IsViewsTextfieldEnabled()) {
38 return new OmniboxViewWin(controller, location_bar, command_updater,
39 popup_window_mode, font_list);
42 OmniboxViewViews* omnibox = new OmniboxViewViews(
43 controller, profile, command_updater, popup_window_mode, location_bar,