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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc

Issue 194110: Convert the AutocompletePopupPositioner into a BubblePositioner in preparatio... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/autocomplete/autocomplete_edit_view_gtk.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 } // namespace 77 } // namespace
78 78
79 AutocompleteEditViewGtk::AutocompleteEditViewGtk( 79 AutocompleteEditViewGtk::AutocompleteEditViewGtk(
80 AutocompleteEditController* controller, 80 AutocompleteEditController* controller,
81 ToolbarModel* toolbar_model, 81 ToolbarModel* toolbar_model,
82 Profile* profile, 82 Profile* profile,
83 CommandUpdater* command_updater, 83 CommandUpdater* command_updater,
84 bool popup_window_mode, 84 bool popup_window_mode,
85 AutocompletePopupPositioner* popup_positioner) 85 const BubblePositioner* bubble_positioner)
86 : text_view_(NULL), 86 : text_view_(NULL),
87 tag_table_(NULL), 87 tag_table_(NULL),
88 text_buffer_(NULL), 88 text_buffer_(NULL),
89 faded_text_tag_(NULL), 89 faded_text_tag_(NULL),
90 secure_scheme_tag_(NULL), 90 secure_scheme_tag_(NULL),
91 insecure_scheme_tag_(NULL), 91 insecure_scheme_tag_(NULL),
92 model_(new AutocompleteEditModel(this, controller, profile)), 92 model_(new AutocompleteEditModel(this, controller, profile)),
93 popup_view_(AutocompletePopupView::CreatePopupView(gfx::Font(), this, 93 popup_view_(AutocompletePopupView::CreatePopupView(gfx::Font(), this,
94 model_.get(), 94 model_.get(),
95 profile, 95 profile,
96 popup_positioner)), 96 bubble_positioner)),
97 controller_(controller), 97 controller_(controller),
98 toolbar_model_(toolbar_model), 98 toolbar_model_(toolbar_model),
99 command_updater_(command_updater), 99 command_updater_(command_updater),
100 popup_window_mode_(popup_window_mode), 100 popup_window_mode_(popup_window_mode),
101 scheme_security_level_(ToolbarModel::NORMAL), 101 scheme_security_level_(ToolbarModel::NORMAL),
102 mark_set_handler_id_(0), 102 mark_set_handler_id_(0),
103 button_1_pressed_(false), 103 button_1_pressed_(false),
104 text_selected_during_click_(false), 104 text_selected_during_click_(false),
105 text_view_focused_before_button_press_(false), 105 text_view_focused_before_button_press_(false),
106 #if !defined(TOOLKIT_VIEWS) 106 #if !defined(TOOLKIT_VIEWS)
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 std::string utf8 = WideToUTF8(text); 1176 std::string utf8 = WideToUTF8(text);
1177 gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length()); 1177 gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length());
1178 SetSelectedRange(range); 1178 SetSelectedRange(range);
1179 } 1179 }
1180 1180
1181 void AutocompleteEditViewGtk::SetSelectedRange(const CharRange& range) { 1181 void AutocompleteEditViewGtk::SetSelectedRange(const CharRange& range) {
1182 GtkTextIter insert, bound; 1182 GtkTextIter insert, bound;
1183 ItersFromCharRange(range, &bound, &insert); 1183 ItersFromCharRange(range, &bound, &insert);
1184 gtk_text_buffer_select_range(text_buffer_, &insert, &bound); 1184 gtk_text_buffer_select_range(text_buffer_, &insert, &bound);
1185 } 1185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698