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/omnibox/omnibox_edit_controller.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
10 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 10 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #if defined(OS_WIN) && !defined(USE_AURA) | 30 #if defined(OS_WIN) && !defined(USE_AURA) |
31 OmniboxViewWin* GetOmniboxViewWin(OmniboxView* view) { | 31 OmniboxViewWin* GetOmniboxViewWin(OmniboxView* view) { |
32 return UseOmniboxViews() ? NULL : static_cast<OmniboxViewWin*>(view); | 32 return UseOmniboxViews() ? NULL : static_cast<OmniboxViewWin*>(view); |
33 } | 33 } |
34 #endif | 34 #endif |
35 | 35 |
36 OmniboxView* CreateOmniboxView(OmniboxEditController* controller, | 36 OmniboxView* CreateOmniboxView(OmniboxEditController* controller, |
37 ToolbarModel* toolbar_model, | 37 ToolbarModel* toolbar_model, |
38 Profile* profile, | 38 Profile* profile, |
39 CommandUpdater* command_updater, | 39 CommandUpdater* command_updater, |
40 bool popup_window_mode, | 40 OmniboxWindowMode window_mode, |
41 LocationBarView* location_bar, | 41 LocationBarView* location_bar, |
42 views::View* popup_parent_view) { | 42 views::View* popup_parent_view) { |
| 43 |
| 44 // TODO(robertshield): Duplicating the enums is ugly. Ask sky@ about a nicer |
| 45 // way of organizing this. |
| 46 OmniboxView::WindowMode omnibox_window_mode = |
| 47 (window_mode == OMNIBOX_WINDOW_MODE_NORMAL) ? OmniboxView::NORMAL : |
| 48 (window_mode == OMNIBOX_WINDOW_MODE_POPUP) ? OmniboxView::POPUP : |
| 49 OmniboxView::DISABLED; |
| 50 |
43 #if defined(OS_WIN) && !defined(USE_AURA) | 51 #if defined(OS_WIN) && !defined(USE_AURA) |
44 if (!UseOmniboxViews()) | 52 if (!UseOmniboxViews()) |
45 return new OmniboxViewWin(controller, toolbar_model, location_bar, | 53 return new OmniboxViewWin(controller, toolbar_model, location_bar, |
46 command_updater, popup_window_mode, location_bar, | 54 command_updater, omnibox_window_mode, |
47 popup_parent_view); | 55 location_bar, popup_parent_view); |
48 #endif | 56 #endif |
49 OmniboxViewViews* omnibox = new OmniboxViewViews(controller, toolbar_model, | 57 OmniboxViewViews* omnibox = new OmniboxViewViews(controller, toolbar_model, |
50 profile, command_updater, popup_window_mode, location_bar); | 58 profile, command_updater, omnibox_window_mode, location_bar); |
51 omnibox->Init(popup_parent_view); | 59 omnibox->Init(popup_parent_view); |
52 return omnibox; | 60 return omnibox; |
53 } | 61 } |
OLD | NEW |