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 <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // balloon_ is set). | 119 // balloon_ is set). |
120 if (!balloon_) | 120 if (!balloon_) |
121 return gfx::Size(); | 121 return gfx::Size(); |
122 | 122 |
123 // Although this may not be the instantaneous size of the balloon if | 123 // Although this may not be the instantaneous size of the balloon if |
124 // called in the middle of an animation, it is the effective size that | 124 // called in the middle of an animation, it is the effective size that |
125 // will result from the animation. | 125 // will result from the animation. |
126 return gfx::Size(GetDesiredTotalWidth(), GetDesiredTotalHeight()); | 126 return gfx::Size(GetDesiredTotalWidth(), GetDesiredTotalHeight()); |
127 } | 127 } |
128 | 128 |
| 129 BalloonHost* BalloonViewImpl::GetHost() const { |
| 130 return html_contents_.get(); |
| 131 } |
| 132 |
129 void BalloonViewImpl::DelayedClose(bool by_user) { | 133 void BalloonViewImpl::DelayedClose(bool by_user) { |
130 html_contents_->Shutdown(); | 134 html_contents_->Shutdown(); |
131 if (frame_container_) { | 135 if (frame_container_) { |
132 // It's possible that |frame_container_| was destroyed before the | 136 // It's possible that |frame_container_| was destroyed before the |
133 // BalloonViewImpl if our related browser window was closed first. | 137 // BalloonViewImpl if our related browser window was closed first. |
134 gtk_widget_hide(frame_container_); | 138 gtk_widget_hide(frame_container_); |
135 } | 139 } |
136 balloon_->OnClose(by_user); | 140 balloon_->OnClose(by_user); |
137 } | 141 } |
138 | 142 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 418 |
415 void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget) { | 419 void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget) { |
416 options_menu_->PopupAsContext(gtk_get_current_event_time()); | 420 options_menu_->PopupAsContext(gtk_get_current_event_time()); |
417 } | 421 } |
418 | 422 |
419 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { | 423 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { |
420 frame_container_ = NULL; | 424 frame_container_ = NULL; |
421 Close(false); | 425 Close(false); |
422 return FALSE; // Propagate. | 426 return FALSE; // Propagate. |
423 } | 427 } |
OLD | NEW |