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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_views.cc

Issue 10702044: Merge 144001 - Update BrowserView::ProcessFullscreen OmniboxViewWin use; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698