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

Side by Side Diff: chrome/browser/ui/gtk/find_bar_gtk.cc

Issue 7063003: Make FindBar obey dialog bounds for GTK. Will fix other platforms in separate patches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switched to container_->allocation.width Created 9 years, 7 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
« no previous file with comments | « chrome/browser/ui/gtk/find_bar_gtk.h ('k') | chrome/browser/ui/views/find_bar_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/gtk/find_bar_gtk.h" 5 #include "chrome/browser/ui/gtk/find_bar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 NULL); 566 NULL);
567 std::string contents(gtk_entry_get_text(GTK_ENTRY(text_entry_))); 567 std::string contents(gtk_entry_get_text(GTK_ENTRY(text_entry_)));
568 return UTF8ToUTF16(contents.substr(cursor_pos, selection_bound)); 568 return UTF8ToUTF16(contents.substr(cursor_pos, selection_bound));
569 } 569 }
570 570
571 string16 FindBarGtk::GetMatchCountText() { 571 string16 FindBarGtk::GetMatchCountText() {
572 std::string contents(gtk_label_get_text(GTK_LABEL(match_count_label_))); 572 std::string contents(gtk_label_get_text(GTK_LABEL(match_count_label_)));
573 return UTF8ToUTF16(contents); 573 return UTF8ToUTF16(contents);
574 } 574 }
575 575
576 int FindBarGtk::GetWidth() {
577 return container_->allocation.width;
578 }
579
576 void FindBarGtk::FindEntryTextInContents(bool forward_search) { 580 void FindBarGtk::FindEntryTextInContents(bool forward_search) {
577 TabContentsWrapper* tab_contents = find_bar_controller_->tab_contents(); 581 TabContentsWrapper* tab_contents = find_bar_controller_->tab_contents();
578 if (!tab_contents) 582 if (!tab_contents)
579 return; 583 return;
580 FindTabHelper* find_tab_helper = tab_contents->find_tab_helper(); 584 FindTabHelper* find_tab_helper = tab_contents->find_tab_helper();
581 585
582 std::string new_contents(gtk_entry_get_text(GTK_ENTRY(text_entry_))); 586 std::string new_contents(gtk_entry_get_text(GTK_ENTRY(text_entry_)));
583 587
584 if (new_contents.length() > 0) { 588 if (new_contents.length() > 0) {
585 find_tab_helper->StartFinding(UTF8ToUTF16(new_contents), forward_search, 589 find_tab_helper->StartFinding(UTF8ToUTF16(new_contents), forward_search,
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 981
978 // static 982 // static
979 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, 983 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event,
980 FindBarGtk* find_bar) { 984 FindBarGtk* find_bar) {
981 g_signal_handlers_disconnect_by_func( 985 g_signal_handlers_disconnect_by_func(
982 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), 986 gdk_keymap_get_for_display(gtk_widget_get_display(entry)),
983 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); 987 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar);
984 988
985 return FALSE; // Continue propagation. 989 return FALSE; // Continue propagation.
986 } 990 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/find_bar_gtk.h ('k') | chrome/browser/ui/views/find_bar_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698