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

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

Issue 10166012: [Coverity] pass-by-ref instead of pass-by-val (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/ui/gtk/find_bar_gtk.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 void FindBarGtk::AudibleAlert() { 413 void FindBarGtk::AudibleAlert() {
414 // This call causes a lot of weird bugs, especially when using the custom 414 // This call causes a lot of weird bugs, especially when using the custom
415 // frame. TODO(estade): if people complain, re-enable it. See 415 // frame. TODO(estade): if people complain, re-enable it. See
416 // http://crbug.com/27635 and others. 416 // http://crbug.com/27635 and others.
417 // 417 //
418 // gtk_widget_error_bell(widget()); 418 // gtk_widget_error_bell(widget());
419 } 419 }
420 420
421 gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { 421 gfx::Rect FindBarGtk::GetDialogPosition(
422 const gfx::Rect& avoid_overlapping_rect) {
422 bool ltr = !base::i18n::IsRTL(); 423 bool ltr = !base::i18n::IsRTL();
423 // 15 is the size of the scrollbar, copied from ScrollbarThemeChromium. 424 // 15 is the size of the scrollbar, copied from ScrollbarThemeChromium.
424 // The height is not used. 425 // The height is not used.
425 // At very low browser widths we can wind up with a negative |dialog_bounds| 426 // At very low browser widths we can wind up with a negative |dialog_bounds|
426 // width, so clamp it to 0. 427 // width, so clamp it to 0.
427 GtkAllocation parent_allocation; 428 GtkAllocation parent_allocation;
428 gtk_widget_get_allocation(gtk_widget_get_parent(widget()), 429 gtk_widget_get_allocation(gtk_widget_get_parent(widget()),
429 &parent_allocation); 430 &parent_allocation);
430 gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0, 431 gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0,
431 std::max(0, parent_allocation.width - (ltr ? 15 : 0)), 0); 432 std::max(0, parent_allocation.width - (ltr ? 15 : 0)), 0);
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 return FALSE; // Continue propagation. 995 return FALSE; // Continue propagation.
995 } 996 }
996 997
997 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { 998 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) {
998 g_signal_handlers_disconnect_by_func( 999 g_signal_handlers_disconnect_by_func(
999 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), 1000 gdk_keymap_get_for_display(gtk_widget_get_display(entry)),
1000 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); 1001 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this);
1001 1002
1002 return FALSE; // Continue propagation. 1003 return FALSE; // Continue propagation.
1003 } 1004 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/find_bar_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698