| OLD | NEW |
| 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/bubble/bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/ui/gtk/bubble/bubble_accelerators_gtk.h" | 10 #include "chrome/browser/ui/gtk/bubble/bubble_accelerators_gtk.h" |
| 11 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 12 #include "chrome/browser/ui/gtk/gtk_util.h" | 11 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 12 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/public/browser/notification_source.h" | 14 #include "content/public/browser/notification_source.h" |
| 15 #include "ui/base/gtk/gtk_compat.h" | 15 #include "ui/base/gtk/gtk_compat.h" |
| 16 #include "ui/base/gtk/gtk_hig_constants.h" | 16 #include "ui/base/gtk/gtk_hig_constants.h" |
| 17 #include "ui/base/gtk/gtk_windowing.h" | 17 #include "ui/base/gtk/gtk_windowing.h" |
| 18 #include "ui/gfx/gtk_util.h" | 18 #include "ui/gfx/gtk_util.h" |
| 19 #include "ui/gfx/path.h" | 19 #include "ui/gfx/path.h" |
| 20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 BubbleGtk* BubbleGtk::Show(GtkWidget* anchor_widget, | 76 BubbleGtk* BubbleGtk::Show(GtkWidget* anchor_widget, |
| 77 const gfx::Rect* rect, | 77 const gfx::Rect* rect, |
| 78 GtkWidget* content, | 78 GtkWidget* content, |
| 79 ArrowLocationGtk arrow_location, | 79 ArrowLocationGtk arrow_location, |
| 80 bool match_system_theme, | 80 bool match_system_theme, |
| 81 bool grab_input, | 81 bool grab_input, |
| 82 GtkThemeService* provider, | 82 ThemeServiceGtk* provider, |
| 83 BubbleDelegateGtk* delegate) { | 83 BubbleDelegateGtk* delegate) { |
| 84 BubbleGtk* bubble = new BubbleGtk(provider, match_system_theme); | 84 BubbleGtk* bubble = new BubbleGtk(provider, match_system_theme); |
| 85 bubble->Init(anchor_widget, rect, content, arrow_location, grab_input); | 85 bubble->Init(anchor_widget, rect, content, arrow_location, grab_input); |
| 86 bubble->set_delegate(delegate); | 86 bubble->set_delegate(delegate); |
| 87 return bubble; | 87 return bubble; |
| 88 } | 88 } |
| 89 | 89 |
| 90 BubbleGtk::BubbleGtk(GtkThemeService* provider, | 90 BubbleGtk::BubbleGtk(ThemeServiceGtk* provider, |
| 91 bool match_system_theme) | 91 bool match_system_theme) |
| 92 : delegate_(NULL), | 92 : delegate_(NULL), |
| 93 window_(NULL), | 93 window_(NULL), |
| 94 theme_service_(provider), | 94 theme_service_(provider), |
| 95 accel_group_(gtk_accel_group_new()), | 95 accel_group_(gtk_accel_group_new()), |
| 96 toplevel_window_(NULL), | 96 toplevel_window_(NULL), |
| 97 anchor_widget_(NULL), | 97 anchor_widget_(NULL), |
| 98 mask_region_(NULL), | 98 mask_region_(NULL), |
| 99 preferred_arrow_location_(ARROW_LOCATION_TOP_LEFT), | 99 preferred_arrow_location_(ARROW_LOCATION_TOP_LEFT), |
| 100 current_arrow_location_(ARROW_LOCATION_TOP_LEFT), | 100 current_arrow_location_(ARROW_LOCATION_TOP_LEFT), |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 gboolean BubbleGtk::OnToplevelUnmap(GtkWidget* widget, GdkEvent* event) { | 636 gboolean BubbleGtk::OnToplevelUnmap(GtkWidget* widget, GdkEvent* event) { |
| 637 Close(); | 637 Close(); |
| 638 return FALSE; | 638 return FALSE; |
| 639 } | 639 } |
| 640 | 640 |
| 641 void BubbleGtk::OnAnchorAllocate(GtkWidget* widget, | 641 void BubbleGtk::OnAnchorAllocate(GtkWidget* widget, |
| 642 GtkAllocation* allocation) { | 642 GtkAllocation* allocation) { |
| 643 if (!UpdateArrowLocation(false)) | 643 if (!UpdateArrowLocation(false)) |
| 644 MoveWindow(); | 644 MoveWindow(); |
| 645 } | 645 } |
| OLD | NEW |