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

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_gtk.cc

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments Created 8 years, 4 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) 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/infobars/infobar_gtk.h" 5 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/infobars/infobar_tab_helper.h" 9 #include "chrome/browser/infobars/infobar_tab_helper.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; 46 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight;
47 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; 47 const int InfoBar::kMaximumArrowTargetHalfWidth = 14;
48 const int InfoBar::kDefaultBarTargetHeight = 36; 48 const int InfoBar::kDefaultBarTargetHeight = 36;
49 49
50 // static 50 // static
51 const int InfoBarGtk::kEndOfLabelSpacing = 6; 51 const int InfoBarGtk::kEndOfLabelSpacing = 6;
52 52
53 InfoBarGtk::InfoBarGtk(InfoBarTabHelper* owner, InfoBarDelegate* delegate) 53 InfoBarGtk::InfoBarGtk(InfoBarTabHelper* owner, InfoBarDelegate* delegate)
54 : InfoBar(owner, delegate), 54 : InfoBar(owner, delegate),
55 theme_service_(GtkThemeService::GetFrom(Profile::FromBrowserContext( 55 theme_service_(GtkThemeService::GetFrom(Profile::FromBrowserContext(
56 owner->web_contents()->GetBrowserContext()))), 56 owner->GetWebContents()->GetBrowserContext()))),
57 signals_(new ui::GtkSignalRegistrar) { 57 signals_(new ui::GtkSignalRegistrar) {
58 DCHECK(delegate); 58 DCHECK(delegate);
59 // Create |hbox_| and pad the sides. 59 // Create |hbox_| and pad the sides.
60 hbox_ = gtk_hbox_new(FALSE, kElementPadding); 60 hbox_ = gtk_hbox_new(FALSE, kElementPadding);
61 61
62 // Make the whole infor bar horizontally shrinkable. 62 // Make the whole infor bar horizontally shrinkable.
63 gtk_widget_set_size_request(hbox_, 0, -1); 63 gtk_widget_set_size_request(hbox_, 0, -1);
64 64
65 GtkWidget* padding = gtk_alignment_new(0, 0, 1, 1); 65 GtkWidget* padding = gtk_alignment_new(0, 0, 1, 1);
66 gtk_alignment_set_padding(GTK_ALIGNMENT(padding), 66 gtk_alignment_set_padding(GTK_ALIGNMENT(padding),
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 const content::NotificationSource& source, 308 const content::NotificationSource& source,
309 const content::NotificationDetails& details) { 309 const content::NotificationDetails& details) {
310 UpdateBorderColor(); 310 UpdateBorderColor();
311 } 311 }
312 312
313 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, 313 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded,
314 GtkWidget* child, 314 GtkWidget* child,
315 GtkRequisition* requisition) { 315 GtkRequisition* requisition) {
316 requisition->height = -1; 316 requisition->height = -1;
317 } 317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698