OLD | NEW |
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/ui/gtk/browser_window_gtk.h" | 8 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
9 #include "chrome/browser/ui/gtk/custom_button.h" | 9 #include "chrome/browser/ui/gtk/custom_button.h" |
10 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 10 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
11 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 11 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
12 #include "chrome/browser/ui/gtk/gtk_util.h" | 12 #include "chrome/browser/ui/gtk/gtk_util.h" |
13 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" | 13 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" |
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
16 #include "content/common/notification_service.h" | 16 #include "content/common/notification_service.h" |
17 #include "ui/base/gtk/gtk_expanded_container.h" | 17 #include "ui/base/gtk/gtk_expanded_container.h" |
| 18 #include "ui/base/gtk/gtk_hig_constants.h" |
18 #include "ui/gfx/gtk_util.h" | 19 #include "ui/gfx/gtk_util.h" |
19 #include "ui/gfx/image/image.h" | 20 #include "ui/gfx/image/image.h" |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 // Pixels between infobar elements. | 24 // Pixels between infobar elements. |
24 const int kElementPadding = 5; | 25 const int kElementPadding = 5; |
25 | 26 |
26 // Extra padding on either end of info bar. | 27 // Extra padding on either end of info bar. |
27 const int kLeftPadding = 5; | 28 const int kLeftPadding = 5; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 106 |
106 GdkColor InfoBarGtk::GetBorderColor() const { | 107 GdkColor InfoBarGtk::GetBorderColor() const { |
107 return theme_service_->GetBorderColor(); | 108 return theme_service_->GetBorderColor(); |
108 } | 109 } |
109 | 110 |
110 int InfoBarGtk::AnimatingHeight() const { | 111 int InfoBarGtk::AnimatingHeight() const { |
111 return animation().is_animating() ? bar_target_height() : 0; | 112 return animation().is_animating() ? bar_target_height() : 0; |
112 } | 113 } |
113 | 114 |
114 GtkWidget* InfoBarGtk::CreateLabel(const std::string& text) { | 115 GtkWidget* InfoBarGtk::CreateLabel(const std::string& text) { |
115 return theme_service_->BuildLabel(text, gtk_util::kGdkBlack); | 116 return theme_service_->BuildLabel(text, ui::kGdkBlack); |
116 } | 117 } |
117 | 118 |
118 GtkWidget* InfoBarGtk::CreateLinkButton(const std::string& text) { | 119 GtkWidget* InfoBarGtk::CreateLinkButton(const std::string& text) { |
119 return theme_service_->BuildChromeLinkButton(text); | 120 return theme_service_->BuildChromeLinkButton(text); |
120 } | 121 } |
121 | 122 |
122 SkColor InfoBarGtk::ConvertGetColor(ColorGetter getter) { | 123 SkColor InfoBarGtk::ConvertGetColor(ColorGetter getter) { |
123 double r, g, b; | 124 double r, g, b; |
124 (this->*getter)(delegate()->GetInfoBarType(), &r, &g, &b); | 125 (this->*getter)(delegate()->GetInfoBarType(), &r, &g, &b); |
125 return SkColorSetARGB(255, 255 * r, 255 * g, 255 * b); | 126 return SkColorSetARGB(255, 255 * r, 255 * g, 255 * b); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 const NotificationSource& source, | 260 const NotificationSource& source, |
260 const NotificationDetails& details) { | 261 const NotificationDetails& details) { |
261 UpdateBorderColor(); | 262 UpdateBorderColor(); |
262 } | 263 } |
263 | 264 |
264 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, | 265 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, |
265 GtkWidget* child, | 266 GtkWidget* child, |
266 GtkRequisition* requisition) { | 267 GtkRequisition* requisition) { |
267 requisition->height = -1; | 268 requisition->height = -1; |
268 } | 269 } |
OLD | NEW |