| 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/theme_install_bubble_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/theme_install_bubble_view_gtk.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/gtk/gtk_util.h" | 9 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 10 #include "chrome/browser/ui/gtk/rounded_window.h" | 10 #include "chrome/browser/ui/gtk/rounded_window.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 ThemeInstallBubbleViewGtk::ThemeInstallBubbleViewGtk(GtkWidget* parent) | 46 ThemeInstallBubbleViewGtk::ThemeInstallBubbleViewGtk(GtkWidget* parent) |
| 47 : widget_(NULL), | 47 : widget_(NULL), |
| 48 parent_(parent), | 48 parent_(parent), |
| 49 num_loads_extant_(1) { | 49 num_loads_extant_(1) { |
| 50 InitWidgets(); | 50 InitWidgets(); |
| 51 | 51 |
| 52 // Close when theme has been installed. | 52 // Close when theme has been installed. |
| 53 registrar_.Add( | 53 registrar_.Add( |
| 54 this, | 54 this, |
| 55 NotificationType::BROWSER_THEME_CHANGED, | 55 chrome::BROWSER_THEME_CHANGED, |
| 56 NotificationService::AllSources()); | 56 NotificationService::AllSources()); |
| 57 | 57 |
| 58 // Close when we are installing an extension, not a theme. | 58 // Close when we are installing an extension, not a theme. |
| 59 registrar_.Add( | 59 registrar_.Add( |
| 60 this, | 60 this, |
| 61 NotificationType::NO_THEME_DETECTED, | 61 chrome::NO_THEME_DETECTED, |
| 62 NotificationService::AllSources()); | 62 NotificationService::AllSources()); |
| 63 registrar_.Add( | 63 registrar_.Add( |
| 64 this, | 64 this, |
| 65 NotificationType::EXTENSION_INSTALLED, | 65 chrome::EXTENSION_INSTALLED, |
| 66 NotificationService::AllSources()); | 66 NotificationService::AllSources()); |
| 67 registrar_.Add( | 67 registrar_.Add( |
| 68 this, | 68 this, |
| 69 NotificationType::EXTENSION_INSTALL_ERROR, | 69 chrome::EXTENSION_INSTALL_ERROR, |
| 70 NotificationService::AllSources()); | 70 NotificationService::AllSources()); |
| 71 | 71 |
| 72 // Don't let the bubble overlap the confirm dialog. | 72 // Don't let the bubble overlap the confirm dialog. |
| 73 registrar_.Add( | 73 registrar_.Add( |
| 74 this, | 74 this, |
| 75 NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, | 75 chrome::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, |
| 76 NotificationService::AllSources()); | 76 NotificationService::AllSources()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 ThemeInstallBubbleViewGtk::~ThemeInstallBubbleViewGtk() { | 79 ThemeInstallBubbleViewGtk::~ThemeInstallBubbleViewGtk() { |
| 80 gtk_widget_destroy(widget_); | 80 gtk_widget_destroy(widget_); |
| 81 instance_ = NULL; | 81 instance_ = NULL; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ThemeInstallBubbleViewGtk::InitWidgets() { | 84 void ThemeInstallBubbleViewGtk::InitWidgets() { |
| 85 // Widgematically, the bubble is just a label in a popup window. | 85 // Widgematically, the bubble is just a label in a popup window. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 0, M_PI_2); | 176 0, M_PI_2); |
| 177 cairo_arc(cr, inner_rect.x(), inner_rect.bottom(), inset, | 177 cairo_arc(cr, inner_rect.x(), inner_rect.bottom(), inset, |
| 178 M_PI_2, M_PI); | 178 M_PI_2, M_PI); |
| 179 | 179 |
| 180 cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, kBubbleOpacity); | 180 cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, kBubbleOpacity); |
| 181 cairo_fill(cr); | 181 cairo_fill(cr); |
| 182 cairo_destroy(cr); | 182 cairo_destroy(cr); |
| 183 | 183 |
| 184 return FALSE; | 184 return FALSE; |
| 185 } | 185 } |
| OLD | NEW |