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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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) 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 G_CALLBACK(OnContentEventBoxExpose), this); 293 G_CALLBACK(OnContentEventBoxExpose), this);
294 294
295 // This alignment isn't centered and is used for spacing in chrome theme 295 // This alignment isn't centered and is used for spacing in chrome theme
296 // mode. (It's also used in GTK mode for padding because left padding doesn't 296 // mode. (It's also used in GTK mode for padding because left padding doesn't
297 // equal bottom padding naturally.) 297 // equal bottom padding naturally.)
298 BuildBorder(content_event_box_, 2, 2, 2, 0, 298 BuildBorder(content_event_box_, 2, 2, 2, 0,
299 &border_bin_, &border_bin_alignment_); 299 &border_bin_, &border_bin_alignment_);
300 gtk_box_pack_end(GTK_BOX(hbox), border_bin_, TRUE, TRUE, 0); 300 gtk_box_pack_end(GTK_BOX(hbox), border_bin_, TRUE, TRUE, 0);
301 301
302 theme_service_->InitThemesFor(this); 302 theme_service_->InitThemesFor(this);
303 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 303 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
304 Source<ThemeService>(theme_service_)); 304 Source<ThemeService>(theme_service_));
305 305
306 g_signal_connect(widget(), "parent-set", G_CALLBACK(OnParentSet), this); 306 g_signal_connect(widget(), "parent-set", G_CALLBACK(OnParentSet), this);
307 307
308 // We take care to avoid showing the slide animator widget. 308 // We take care to avoid showing the slide animator widget.
309 gtk_widget_show_all(container_); 309 gtk_widget_show_all(container_);
310 gtk_widget_show(widget()); 310 gtk_widget_show(widget());
311 } 311 }
312 312
313 FindBarController* FindBarGtk::GetFindBarController() const { 313 FindBarController* FindBarGtk::GetFindBarController() const {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (focus_store_.widget()) 449 if (focus_store_.widget())
450 gtk_widget_grab_focus(focus_store_.widget()); 450 gtk_widget_grab_focus(focus_store_.widget());
451 else 451 else
452 find_bar_controller_->tab_contents()->tab_contents()->Focus(); 452 find_bar_controller_->tab_contents()->tab_contents()->Focus();
453 } 453 }
454 454
455 FindBarTesting* FindBarGtk::GetFindBarTesting() { 455 FindBarTesting* FindBarGtk::GetFindBarTesting() {
456 return this; 456 return this;
457 } 457 }
458 458
459 void FindBarGtk::Observe(NotificationType type, 459 void FindBarGtk::Observe(int type,
460 const NotificationSource& source, 460 const NotificationSource& source,
461 const NotificationDetails& details) { 461 const NotificationDetails& details) {
462 DCHECK_EQ(type.value, NotificationType::BROWSER_THEME_CHANGED); 462 DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED);
463 463
464 // Force reshapings of the find bar window. 464 // Force reshapings of the find bar window.
465 container_width_ = -1; 465 container_width_ = -1;
466 container_height_ = -1; 466 container_height_ = -1;
467 467
468 if (theme_service_->UsingNativeTheme()) { 468 if (theme_service_->UsingNativeTheme()) {
469 gtk_widget_modify_cursor(text_entry_, NULL, NULL); 469 gtk_widget_modify_cursor(text_entry_, NULL, NULL);
470 gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, NULL); 470 gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, NULL);
471 gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, NULL); 471 gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, NULL);
472 472
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 981
982 // static 982 // static
983 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, 983 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event,
984 FindBarGtk* find_bar) { 984 FindBarGtk* find_bar) {
985 g_signal_handlers_disconnect_by_func( 985 g_signal_handlers_disconnect_by_func(
986 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), 986 gdk_keymap_get_for_display(gtk_widget_get_display(entry)),
987 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); 987 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar);
988 988
989 return FALSE; // Continue propagation. 989 return FALSE; // Continue propagation.
990 } 990 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698