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/views/notifications/balloon_view_views.h" | 5 #include "chrome/browser/ui/views/notifications/balloon_view_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 menu_runner_.reset(new views::MenuRunner(options_menu_model_.get())); | 143 menu_runner_.reset(new views::MenuRunner(options_menu_model_.get())); |
144 | 144 |
145 gfx::Point screen_location; | 145 gfx::Point screen_location; |
146 views::View::ConvertPointToScreen(options_menu_button_, &screen_location); | 146 views::View::ConvertPointToScreen(options_menu_button_, &screen_location); |
147 if (menu_runner_->RunMenuAt( | 147 if (menu_runner_->RunMenuAt( |
148 source->GetWidget()->GetTopLevelWidget(), | 148 source->GetWidget()->GetTopLevelWidget(), |
149 options_menu_button_, | 149 options_menu_button_, |
150 gfx::Rect(screen_location, options_menu_button_->size()), | 150 gfx::Rect(screen_location, options_menu_button_->size()), |
151 views::MenuItemView::TOPRIGHT, | 151 views::MenuItemView::TOPRIGHT, |
| 152 ui::MENU_SOURCE_NONE, |
152 views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) | 153 views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) |
153 return; | 154 return; |
154 } | 155 } |
155 | 156 |
156 void BalloonViewImpl::OnDisplayChanged() { | 157 void BalloonViewImpl::OnDisplayChanged() { |
157 collection_->DisplayChanged(); | 158 collection_->DisplayChanged(); |
158 } | 159 } |
159 | 160 |
160 void BalloonViewImpl::OnWorkAreaChanged() { | 161 void BalloonViewImpl::OnWorkAreaChanged() { |
161 collection_->DisplayChanged(); | 162 collection_->DisplayChanged(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 return; | 523 return; |
523 } | 524 } |
524 | 525 |
525 // If the renderer process attached to this balloon is disconnected | 526 // If the renderer process attached to this balloon is disconnected |
526 // (e.g., because of a crash), we want to close the balloon. | 527 // (e.g., because of a crash), we want to close the balloon. |
527 notification_registrar_.Remove( | 528 notification_registrar_.Remove( |
528 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 529 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
529 content::Source<Balloon>(balloon_)); | 530 content::Source<Balloon>(balloon_)); |
530 Close(false); | 531 Close(false); |
531 } | 532 } |
OLD | NEW |