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/status_icons/status_icon_gtk.h" | 5 #include "chrome/browser/ui/gtk/status_icons/status_icon_gtk.h" |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/gtk/menu_gtk.h" | 9 #include "chrome/browser/ui/gtk/menu_gtk.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // pressed status icons. | 38 // pressed status icons. |
39 } | 39 } |
40 | 40 |
41 void StatusIconGtk::SetToolTip(const string16& tool_tip) { | 41 void StatusIconGtk::SetToolTip(const string16& tool_tip) { |
42 gtk_status_icon_set_tooltip(icon_, UTF16ToUTF8(tool_tip).c_str()); | 42 gtk_status_icon_set_tooltip(icon_, UTF16ToUTF8(tool_tip).c_str()); |
43 } | 43 } |
44 | 44 |
45 void StatusIconGtk::DisplayBalloon(const SkBitmap& icon, | 45 void StatusIconGtk::DisplayBalloon(const SkBitmap& icon, |
46 const string16& title, | 46 const string16& title, |
47 const string16& contents) { | 47 const string16& contents) { |
48 // TODO(atwilson): Figure out the right thing to do here. | 48 notification_.DisplayBalloon(icon, title, contents); |
49 // http://crbug.com/74970 | |
50 } | 49 } |
51 | 50 |
52 void StatusIconGtk::OnClick(GtkWidget* widget) { | 51 void StatusIconGtk::OnClick(GtkWidget* widget) { |
53 DispatchClickEvent(); | 52 DispatchClickEvent(); |
54 } | 53 } |
55 | 54 |
56 void StatusIconGtk::UpdatePlatformContextMenu(ui::MenuModel* model) { | 55 void StatusIconGtk::UpdatePlatformContextMenu(ui::MenuModel* model) { |
57 if (!model) | 56 if (!model) |
58 menu_.reset(); | 57 menu_.reset(); |
59 else | 58 else |
60 menu_.reset(new MenuGtk(NULL, model)); | 59 menu_.reset(new MenuGtk(NULL, model)); |
61 } | 60 } |
62 | 61 |
63 void StatusIconGtk::OnPopupMenu(GtkWidget* widget, guint button, guint time) { | 62 void StatusIconGtk::OnPopupMenu(GtkWidget* widget, guint button, guint time) { |
64 // If we have a menu - display it. | 63 // If we have a menu - display it. |
65 if (menu_.get()) | 64 if (menu_.get()) |
66 menu_->PopupAsContextForStatusIcon(time, button, icon_); | 65 menu_->PopupAsContextForStatusIcon(time, button, icon_); |
67 } | 66 } |
OLD | NEW |