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/chromeos/notifications/balloon_view.h" | 5 #include "chrome/browser/chromeos/notifications/balloon_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // TODO(oshima): We're not sure if this is the right place to | 98 // TODO(oshima): We're not sure if this is the right place to |
99 // add & show in the panel. Revisit the deisgn once we have a collection | 99 // add & show in the panel. Revisit the deisgn once we have a collection |
100 // for chromeos. | 100 // for chromeos. |
101 chromeos::NotificationPanel::Get()->Add(this); | 101 chromeos::NotificationPanel::Get()->Add(this); |
102 chromeos::NotificationPanel::Get()->Show(); | 102 chromeos::NotificationPanel::Get()->Show(); |
103 notification_registrar_.Add(this, | 103 notification_registrar_.Add(this, |
104 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); | 104 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); |
105 } | 105 } |
106 | 106 |
107 void BalloonViewImpl::Close(bool by_user) { | 107 void BalloonViewImpl::Close(bool by_user) { |
108 MessageLoop::current()->PostTask(FROM_HERE, | 108 MessageLoop::current()->PostTask( |
| 109 FROM_HERE, |
109 method_factory_.NewRunnableMethod( | 110 method_factory_.NewRunnableMethod( |
110 &BalloonViewImpl::DelayedClose, by_user)); | 111 &BalloonViewImpl::DelayedClose, by_user)); |
111 } | 112 } |
112 | 113 |
113 gfx::Size BalloonViewImpl::GetSize() const { | 114 gfx::Size BalloonViewImpl::GetSize() const { |
114 // Not used. The layout is managed by the Panel. | 115 // Not used. The layout is managed by the Panel. |
115 return gfx::Size(0, 0); | 116 return gfx::Size(0, 0); |
116 } | 117 } |
117 | 118 |
118 void BalloonViewImpl::RepositionToBalloon() { | 119 void BalloonViewImpl::RepositionToBalloon() { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 options_menu_menu_.reset(new views::Menu2(options_menu_contents_.get())); | 220 options_menu_menu_.reset(new views::Menu2(options_menu_contents_.get())); |
220 } | 221 } |
221 | 222 |
222 void BalloonViewImpl::DelayedClose(bool by_user) { | 223 void BalloonViewImpl::DelayedClose(bool by_user) { |
223 html_contents_->Shutdown(); | 224 html_contents_->Shutdown(); |
224 // Remove html_contents from panel. | 225 // Remove html_contents from panel. |
225 chromeos::NotificationPanel::Get()->Remove(this); | 226 chromeos::NotificationPanel::Get()->Remove(this); |
226 | 227 |
227 balloon_->OnClose(by_user); | 228 balloon_->OnClose(by_user); |
228 } | 229 } |
OLD | NEW |