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

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_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/infobars/infobar_gtk.h" 5 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/platform_util.h" 8 #include "chrome/browser/platform_util.h"
9 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 9 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
10 #include "chrome/browser/ui/gtk/custom_button.h" 10 #include "chrome/browser/ui/gtk/custom_button.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 G_CALLBACK(OnCloseButtonThunk), this); 84 G_CALLBACK(OnCloseButtonThunk), this);
85 85
86 widget_.Own(gtk_expanded_container_new()); 86 widget_.Own(gtk_expanded_container_new());
87 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_); 87 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_);
88 gtk_widget_set_size_request(widget_.get(), -1, 0); 88 gtk_widget_set_size_request(widget_.get(), -1, 0);
89 89
90 g_signal_connect(widget_.get(), "child-size-request", 90 g_signal_connect(widget_.get(), "child-size-request",
91 G_CALLBACK(OnChildSizeRequestThunk), 91 G_CALLBACK(OnChildSizeRequestThunk),
92 this); 92 this);
93 93
94 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 94 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
95 Source<ThemeService>(theme_service_)); 95 Source<ThemeService>(theme_service_));
96 UpdateBorderColor(); 96 UpdateBorderColor();
97 } 97 }
98 98
99 InfoBarGtk::~InfoBarGtk() { 99 InfoBarGtk::~InfoBarGtk() {
100 } 100 }
101 101
102 GtkWidget* InfoBarGtk::widget() { 102 GtkWidget* InfoBarGtk::widget() {
103 return widget_.get(); 103 return widget_.get();
104 } 104 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void InfoBarGtk::PlatformSpecificOnHeightsRecalculated() { 244 void InfoBarGtk::PlatformSpecificOnHeightsRecalculated() {
245 GtkRequisition req; 245 GtkRequisition req;
246 gtk_widget_size_request(bg_box_, &req); 246 gtk_widget_size_request(bg_box_, &req);
247 gtk_expanded_container_move(GTK_EXPANDED_CONTAINER(widget_.get()), 247 gtk_expanded_container_move(GTK_EXPANDED_CONTAINER(widget_.get()),
248 bg_box_, 0, bar_height() - req.height); 248 bg_box_, 0, bar_height() - req.height);
249 249
250 gtk_widget_set_size_request(widget_.get(), -1, bar_height()); 250 gtk_widget_set_size_request(widget_.get(), -1, bar_height());
251 gtk_widget_queue_draw(widget_.get()); 251 gtk_widget_queue_draw(widget_.get());
252 } 252 }
253 253
254 void InfoBarGtk::Observe(NotificationType type, 254 void InfoBarGtk::Observe(int type,
255 const NotificationSource& source, 255 const NotificationSource& source,
256 const NotificationDetails& details) { 256 const NotificationDetails& details) {
257 UpdateBorderColor(); 257 UpdateBorderColor();
258 } 258 }
259 259
260 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, 260 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded,
261 GtkWidget* child, 261 GtkWidget* child,
262 GtkRequisition* requisition) { 262 GtkRequisition* requisition) {
263 requisition->height = -1; 263 requisition->height = -1;
264 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698