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 "chrome/browser/ui/views/omnibox/omnibox_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
9 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 9 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
10 #include "ui/base/ui_base_switches.h" | 10 #include "ui/base/ui_base_switches.h" |
11 | 11 |
12 #if defined(OS_WIN) && !defined(USE_AURA) | 12 #if defined(OS_WIN) && !defined(USE_AURA) |
13 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 13 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
14 #endif | 14 #endif |
15 | 15 |
16 OmniboxView* CreateOmniboxView(AutocompleteEditController* controller, | 16 OmniboxView* CreateOmniboxView(AutocompleteEditController* controller, |
17 ToolbarModel* toolbar_model, | 17 ToolbarModel* toolbar_model, |
18 Profile* profile, | 18 Profile* profile, |
19 CommandUpdater* command_updater, | 19 CommandUpdater* command_updater, |
20 bool popup_window_mode, | 20 bool popup_window_mode, |
21 LocationBarView* location_bar) { | 21 LocationBarView* location_bar, |
| 22 views::View* popup_parent_view) { |
22 #if defined(OS_WIN) && !defined(USE_AURA) | 23 #if defined(OS_WIN) && !defined(USE_AURA) |
23 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 24 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
24 if (!command_line->HasSwitch(switches::kEnableViewsTextfield)) | 25 if (!command_line->HasSwitch(switches::kEnableViewsTextfield)) |
25 return new OmniboxViewWin(controller, toolbar_model, location_bar, | 26 return new OmniboxViewWin(controller, toolbar_model, location_bar, |
26 command_updater, popup_window_mode, location_bar); | 27 command_updater, popup_window_mode, location_bar); |
27 #endif | 28 #endif |
28 OmniboxViewViews* omnibox = new OmniboxViewViews(controller, toolbar_model, | 29 OmniboxViewViews* omnibox = new OmniboxViewViews(controller, toolbar_model, |
29 profile, command_updater, popup_window_mode, location_bar); | 30 profile, command_updater, popup_window_mode, location_bar); |
30 omnibox->Init(); | 31 omnibox->Init(popup_parent_view); |
31 return omnibox; | 32 return omnibox; |
32 } | 33 } |
OLD | NEW |