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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 10828265: Replace views::LocatedEvent with ui::LocatedEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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_view.cc ('k') | ash/wm/workspace/frame_maximize_button.h » ('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/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell/panel_window.h" 8 #include "ash/shell/panel_window.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/audio/tray_volume.h" 10 #include "ash/system/audio/tray_volume.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 457
458 bool SystemTray::PerformAction(const ui::Event& event) { 458 bool SystemTray::PerformAction(const ui::Event& event) {
459 // If we're already showing the default view, hide it; otherwise, show it 459 // If we're already showing the default view, hide it; otherwise, show it
460 // (and hide any popup that's currently shown). 460 // (and hide any popup that's currently shown).
461 if (bubble_.get() && 461 if (bubble_.get() &&
462 bubble_->bubble_type() == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) { 462 bubble_->bubble_type() == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) {
463 bubble_->Close(); 463 bubble_->Close();
464 } else { 464 } else {
465 int arrow_offset = TrayBubbleView::InitParams::kArrowDefaultOffset; 465 int arrow_offset = TrayBubbleView::InitParams::kArrowDefaultOffset;
466 if (event.IsMouseEvent() || event.type() == ui::ET_GESTURE_TAP) { 466 if (event.IsMouseEvent() || event.type() == ui::ET_GESTURE_TAP) {
467 const views::LocatedEvent& located_event = 467 const ui::LocatedEvent& located_event =
468 static_cast<const views::LocatedEvent&>(event); 468 static_cast<const ui::LocatedEvent&>(event);
469 if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) { 469 if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) {
470 gfx::Point point(located_event.x(), 0); 470 gfx::Point point(located_event.x(), 0);
471 ConvertPointToWidget(this, &point); 471 ConvertPointToWidget(this, &point);
472 arrow_offset = point.x(); 472 arrow_offset = point.x();
473 } 473 }
474 } 474 }
475 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); 475 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset);
476 } 476 }
477 return true; 477 return true;
478 } 478 }
(...skipping 24 matching lines...) Expand all
503 503
504 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) { 504 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) {
505 // The tray itself expands to the right and bottom edge of the screen to make 505 // The tray itself expands to the right and bottom edge of the screen to make
506 // sure clicking on the edges brings up the popup. However, the focus border 506 // sure clicking on the edges brings up the popup. However, the focus border
507 // should be only around the container. 507 // should be only around the container.
508 if (GetWidget() && GetWidget()->IsActive()) 508 if (GetWidget() && GetWidget()->IsActive())
509 DrawBorder(canvas, GetContentsBounds()); 509 DrawBorder(canvas, GetContentsBounds());
510 } 510 }
511 511
512 } // namespace ash 512 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_view.cc ('k') | ash/wm/workspace/frame_maximize_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698