| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/notifications/balloon_view_gtk.h" | 5 #include "chrome/browser/gtk/notifications/balloon_view_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/gfx/canvas.h" | |
| 11 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 12 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 13 #include "app/slide_animation.h" | 12 #include "app/slide_animation.h" |
| 14 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 15 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 16 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
| 17 #include "chrome/browser/browser_theme_provider.h" | 16 #include "chrome/browser/browser_theme_provider.h" |
| 18 #include "chrome/browser/browser_window.h" | 17 #include "chrome/browser/browser_window.h" |
| 19 #include "chrome/browser/extensions/extension_host.h" | 18 #include "chrome/browser/extensions/extension_host.h" |
| 20 #include "chrome/browser/extensions/extension_process_manager.h" | 19 #include "chrome/browser/extensions/extension_process_manager.h" |
| 21 #include "chrome/browser/gtk/gtk_chrome_button.h" | 20 #include "chrome/browser/gtk/gtk_chrome_button.h" |
| 22 #include "chrome/browser/gtk/gtk_theme_provider.h" | 21 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 23 #include "chrome/browser/gtk/gtk_util.h" | 22 #include "chrome/browser/gtk/gtk_util.h" |
| 24 #include "chrome/browser/gtk/info_bubble_gtk.h" | 23 #include "chrome/browser/gtk/info_bubble_gtk.h" |
| 25 #include "chrome/browser/gtk/menu_gtk.h" | 24 #include "chrome/browser/gtk/menu_gtk.h" |
| 26 #include "chrome/browser/gtk/nine_box.h" | 25 #include "chrome/browser/gtk/nine_box.h" |
| 27 #include "chrome/browser/gtk/notifications/balloon_view_host_gtk.h" | 26 #include "chrome/browser/gtk/notifications/balloon_view_host_gtk.h" |
| 28 #include "chrome/browser/gtk/notifications/notification_options_menu_model.h" | 27 #include "chrome/browser/gtk/notifications/notification_options_menu_model.h" |
| 29 #include "chrome/browser/notifications/balloon.h" | 28 #include "chrome/browser/notifications/balloon.h" |
| 30 #include "chrome/browser/notifications/desktop_notification_service.h" | 29 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 31 #include "chrome/browser/profile.h" | 30 #include "chrome/browser/profile.h" |
| 32 #include "chrome/browser/renderer_host/render_view_host.h" | 31 #include "chrome/browser/renderer_host/render_view_host.h" |
| 33 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 32 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 34 #include "chrome/common/extensions/extension.h" | 33 #include "chrome/common/extensions/extension.h" |
| 35 #include "chrome/common/notification_details.h" | 34 #include "chrome/common/notification_details.h" |
| 36 #include "chrome/common/notification_service.h" | 35 #include "chrome/common/notification_service.h" |
| 37 #include "chrome/common/notification_source.h" | 36 #include "chrome/common/notification_source.h" |
| 38 #include "chrome/common/notification_type.h" | 37 #include "chrome/common/notification_type.h" |
| 38 #include "gfx/canvas.h" |
| 39 #include "gfx/insets.h" | 39 #include "gfx/insets.h" |
| 40 #include "gfx/native_widget_types.h" | 40 #include "gfx/native_widget_types.h" |
| 41 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
| 42 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 // Margin, in pixels, between the notification frame and the contents | 46 // Margin, in pixels, between the notification frame and the contents |
| 47 // of the notification. | 47 // of the notification. |
| 48 const int kTopMargin = 1; | 48 const int kTopMargin = 1; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 NOTREACHED(); | 365 NOTREACHED(); |
| 366 return; | 366 return; |
| 367 } | 367 } |
| 368 | 368 |
| 369 // If the renderer process attached to this balloon is disconnected | 369 // If the renderer process attached to this balloon is disconnected |
| 370 // (e.g., because of a crash), we want to close the balloon. | 370 // (e.g., because of a crash), we want to close the balloon. |
| 371 notification_registrar_.Remove(this, | 371 notification_registrar_.Remove(this, |
| 372 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); | 372 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); |
| 373 Close(false); | 373 Close(false); |
| 374 } | 374 } |
| OLD | NEW |