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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 1875033004: Fix tooltips for Chrome OS shelf overflow icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 4 years, 8 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
« no previous file with comments | « ash/shelf/overflow_bubble_view.cc ('k') | no next file » | 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/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 return this; 1502 return this;
1503 } 1503 }
1504 1504
1505 void ShelfView::GetAccessibleState(ui::AXViewState* state) { 1505 void ShelfView::GetAccessibleState(ui::AXViewState* state) {
1506 state->role = ui::AX_ROLE_TOOLBAR; 1506 state->role = ui::AX_ROLE_TOOLBAR;
1507 state->name = l10n_util::GetStringUTF16(IDS_ASH_SHELF_ACCESSIBLE_NAME); 1507 state->name = l10n_util::GetStringUTF16(IDS_ASH_SHELF_ACCESSIBLE_NAME);
1508 } 1508 }
1509 1509
1510 void ShelfView::ViewHierarchyChanged( 1510 void ShelfView::ViewHierarchyChanged(
1511 const ViewHierarchyChangedDetails& details) { 1511 const ViewHierarchyChangedDetails& details) {
1512 if (details.is_add && details.child == this && GetWidget()) 1512 if (details.is_add && details.child == this)
1513 tooltip_.Init(); 1513 tooltip_.Init();
1514 } 1514 }
1515 1515
1516 void ShelfView::OnGestureEvent(ui::GestureEvent* event) { 1516 void ShelfView::OnGestureEvent(ui::GestureEvent* event) {
1517 aura::Window* target_window = static_cast<views::View*>(event->target()) 1517 aura::Window* target_window = static_cast<views::View*>(event->target())
1518 ->GetWidget() 1518 ->GetWidget()
1519 ->GetNativeWindow(); 1519 ->GetNativeWindow();
1520 if (gesture_handler_.ProcessGestureEvent(*event, target_window)) 1520 if (gesture_handler_.ProcessGestureEvent(*event, target_window))
1521 event->StopPropagation(); 1521 event->StopPropagation();
1522 } 1522 }
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 1876
1877 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { 1877 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const {
1878 const gfx::Rect bounds = GetBoundsInScreen(); 1878 const gfx::Rect bounds = GetBoundsInScreen();
1879 int distance = shelf_->SelectValueForShelfAlignment( 1879 int distance = shelf_->SelectValueForShelfAlignment(
1880 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), 1880 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(),
1881 bounds.x() - coordinate.x()); 1881 bounds.x() - coordinate.x());
1882 return distance > 0 ? distance : 0; 1882 return distance > 0 ? distance : 0;
1883 } 1883 }
1884 1884
1885 } // namespace ash 1885 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698