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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_views.cc

Issue 6349101: Create a new autocomplete popup for touch. This CL depends on (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: addressed comments Created 9 years, 10 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/autocomplete/autocomplete_edit_view_views.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
index 68e84ec27320340f252fc2d67298f4c9d7ee9dfd..2abad5d81810bf80d7c349bd197d6539a9f90ea4 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/command_updater.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h"
+#include "chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/common/notification_service.h"
#include "googleurl/src/gurl.h"
@@ -110,8 +111,7 @@ AutocompleteEditViewViews::AutocompleteEditViewViews(
bool popup_window_mode,
const views::View* location_bar)
: model_(new AutocompleteEditModel(this, controller, profile)),
- popup_view_(new AutocompletePopupContentsView(
- gfx::Font(), this, model_.get(), profile, location_bar)),
+ popup_view_(CreatePopupView(profile, location_bar)),
controller_(controller),
toolbar_model_(toolbar_model),
command_updater_(command_updater),
@@ -641,3 +641,14 @@ void AutocompleteEditViewViews::SelectRange(size_t caret, size_t end) {
const views::TextRange range(caret, end);
textfield_->SelectRange(range);
}
+
+AutocompletePopupView* AutocompleteEditViewViews::CreatePopupView(
+ Profile* profile, const views::View* location_bar) {
Peter Kasting 2011/02/17 23:08:57 Nit: One arg per line
varunjain 2011/02/18 00:16:34 Done.
+#if defined(TOUCH_UI)
+ return new TouchAutocompletePopupContentsView(
+ gfx::Font(), this, model_.get(), profile, location_bar);
Peter Kasting 2011/02/17 23:08:57 Nit: Why not bring this second line out of the #if
varunjain 2011/02/18 00:16:34 It looked better to me that way... but anyways. Do
+#else
+ return new AutocompletePopupContentsView(
+ gfx::Font(), this, model_.get(), profile, location_bar);
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698