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

Side by Side Diff: ash/launcher/launcher_button.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 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
« no previous file with comments | « ash/launcher/launcher_button.h ('k') | ash/launcher/launcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ash/launcher/launcher_button.h" 5 #include "ash/launcher/launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher_button_host.h" 9 #include "ash/launcher/launcher_button_host.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 if (state & STATE_ATTENTION) 320 if (state & STATE_ATTENTION)
321 bar_->ShowAttention(false); 321 bar_->ShowAttention(false);
322 } 322 }
323 } 323 }
324 324
325 gfx::Rect LauncherButton::GetIconBounds() const { 325 gfx::Rect LauncherButton::GetIconBounds() const {
326 return icon_view_->bounds(); 326 return icon_view_->bounds();
327 } 327 }
328 328
329 void LauncherButton::ShowContextMenu(const gfx::Point& p, 329 void LauncherButton::ShowContextMenu(const gfx::Point& p,
330 bool is_mouse_gesture) { 330 ui::MenuSourceType source_type) {
331 if (!context_menu_controller()) 331 if (!context_menu_controller())
332 return; 332 return;
333 333
334 bool destroyed = false; 334 bool destroyed = false;
335 destroyed_flag_ = &destroyed; 335 destroyed_flag_ = &destroyed;
336 336
337 CustomButton::ShowContextMenu(p, is_mouse_gesture); 337 CustomButton::ShowContextMenu(p, source_type);
338 338
339 if (!destroyed) { 339 if (!destroyed) {
340 destroyed_flag_ = NULL; 340 destroyed_flag_ = NULL;
341 // The menu will not propagate mouse events while its shown. To address, 341 // The menu will not propagate mouse events while its shown. To address,
342 // the hover state gets cleared once the menu was shown (and this was not 342 // the hover state gets cleared once the menu was shown (and this was not
343 // destroyed). 343 // destroyed).
344 ClearState(STATE_HOVERED); 344 ClearState(STATE_HOVERED);
345 } 345 }
346 } 346 }
347 347
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 views::ImageView::TRAILING, 541 views::ImageView::TRAILING,
542 views::ImageView::CENTER, 542 views::ImageView::CENTER,
543 views::ImageView::CENTER, 543 views::ImageView::CENTER,
544 views::ImageView::LEADING)); 544 views::ImageView::LEADING));
545 bar_->SchedulePaint(); 545 bar_->SchedulePaint();
546 SchedulePaint(); 546 SchedulePaint();
547 } 547 }
548 548
549 } // namespace internal 549 } // namespace internal
550 } // namespace ash 550 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_button.h ('k') | ash/launcher/launcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698