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

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

Issue 10636023: Update BrowserView::ProcessFullscreen OmniboxViewWin use; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. 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
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_views.cc b/chrome/browser/ui/views/omnibox/omnibox_views.cc
index a56b0bd65cf399bd55e2b646a3636c500ebc334b..498446f286d956478b59a5bc93bdd827eb92756c 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_views.cc
@@ -14,6 +14,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(OmniboxEditController* controller,
ToolbarModel* toolbar_model,
Profile* profile,
@@ -22,8 +41,7 @@ OmniboxView* CreateOmniboxView(OmniboxEditController* controller,
LocationBarView* location_bar,
views::View* popup_parent_view) {
#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,
popup_parent_view);
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698