OLD | NEW |
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 "base/gfx/gtk_util.h" | 10 #include "base/gfx/gtk_util.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 PageTransition::Type transition, | 170 PageTransition::Type transition, |
171 const GURL& alternate_nav_url, | 171 const GURL& alternate_nav_url, |
172 size_t selected_line, | 172 size_t selected_line, |
173 const std::wstring& keyword) { | 173 const std::wstring& keyword) { |
174 if (!url.is_valid()) | 174 if (!url.is_valid()) |
175 return; | 175 return; |
176 | 176 |
177 model_->SendOpenNotification(selected_line, keyword); | 177 model_->SendOpenNotification(selected_line, keyword); |
178 | 178 |
179 if (disposition != NEW_BACKGROUND_TAB) | 179 if (disposition != NEW_BACKGROUND_TAB) |
180 RevertAll(); // Revert the box to its unedited state | 180 RevertAll(); // Revert the box to its unedited state. |
181 controller_->OnAutocompleteAccept(url, disposition, transition, | 181 controller_->OnAutocompleteAccept(url, disposition, transition, |
182 alternate_nav_url); | 182 alternate_nav_url); |
183 } | 183 } |
184 | 184 |
185 std::wstring AutocompleteEditViewGtk::GetText() const { | 185 std::wstring AutocompleteEditViewGtk::GetText() const { |
186 GtkTextIter start, end; | 186 GtkTextIter start, end; |
187 gtk_text_buffer_get_bounds(text_buffer_, &start, &end); | 187 gtk_text_buffer_get_bounds(text_buffer_, &start, &end); |
188 gchar* utf8 = gtk_text_buffer_get_text(text_buffer_, &start, &end, false); | 188 gchar* utf8 = gtk_text_buffer_get_text(text_buffer_, &start, &end, false); |
189 std::wstring out(UTF8ToWide(utf8)); | 189 std::wstring out(UTF8ToWide(utf8)); |
190 g_free(utf8); | 190 g_free(utf8); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 gtk_text_buffer_apply_tag(text_buffer_, insecure_scheme_tag_, | 537 gtk_text_buffer_apply_tag(text_buffer_, insecure_scheme_tag_, |
538 &start, &end); | 538 &start, &end); |
539 } | 539 } |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 void AutocompleteEditViewGtk::TextChanged() { | 543 void AutocompleteEditViewGtk::TextChanged() { |
544 EmphasizeURLComponents(); | 544 EmphasizeURLComponents(); |
545 controller_->OnChanged(); | 545 controller_->OnChanged(); |
546 } | 546 } |
OLD | NEW |