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 // Note: this file is used by Aura on all linux platforms, even though it | 5 // Note: this file is used by Aura on all linux platforms, even though it |
6 // is currently in a chromeos specific location. | 6 // is currently in a chromeos specific location. |
7 | 7 |
8 #include "chrome/browser/chromeos/status/memory_menu_button.h" | 8 #include "chrome/browser/chromeos/status/memory_menu_button.h" |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 default: | 211 default: |
212 NOTREACHED(); | 212 NOTREACHED(); |
213 break; | 213 break; |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 int MemoryMenuButton::horizontal_padding() { | 217 int MemoryMenuButton::horizontal_padding() { |
218 return 3; | 218 return 3; |
219 } | 219 } |
220 | 220 |
221 // MemoryMenuButton, views::MenuButtonDelegate implementation: | 221 // MemoryMenuButton, views::MenuButtonListener implementation: |
222 | 222 |
223 void MemoryMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { | 223 void MemoryMenuButton::OnMenuButtonClicked(views::View* source, |
| 224 const gfx::Point& point) { |
224 // View passed in must be a views::MenuButton, i.e. the MemoryMenuButton. | 225 // View passed in must be a views::MenuButton, i.e. the MemoryMenuButton. |
225 DCHECK_EQ(source, this); | 226 DCHECK_EQ(source, this); |
226 | 227 |
227 menu_runner_.reset(new views::MenuRunner(CreateMenu())); | 228 menu_runner_.reset(new views::MenuRunner(CreateMenu())); |
228 gfx::Point screen_location; | 229 gfx::Point screen_location; |
229 views::View::ConvertPointToScreen(source, &screen_location); | 230 views::View::ConvertPointToScreen(source, &screen_location); |
230 gfx::Rect bounds(screen_location, source->size()); | 231 gfx::Rect bounds(screen_location, source->size()); |
231 if (menu_runner_->RunMenuAt( | 232 if (menu_runner_->RunMenuAt( |
232 source->GetWidget()->GetTopLevelWidget(), this, bounds, | 233 source->GetWidget()->GetTopLevelWidget(), this, bounds, |
233 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) == | 234 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) == |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // A kill is a very interesting event, so repaint immediately. | 273 // A kill is a very interesting event, so repaint immediately. |
273 UpdateText(); | 274 UpdateText(); |
274 } | 275 } |
275 break; | 276 break; |
276 } | 277 } |
277 default: | 278 default: |
278 NOTREACHED() << L"Received unexpected notification"; | 279 NOTREACHED() << L"Received unexpected notification"; |
279 break; | 280 break; |
280 } | 281 } |
281 } | 282 } |
OLD | NEW |