Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: chrome/browser/chromeos/status/memory_menu_button.cc

Issue 9693022: views: Rename MenuButtonDelegate::RunMenu to something more obvious. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: menu_button_listener.h Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/memory_menu_button.h ('k') | chrome/browser/chromeos/status/network_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698