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

Side by Side Diff: ui/views/bubble/tray_bubble_view.cc

Issue 17045003: Test delegate_ in TrayBubbleView::GetAccessibleState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | « no previous file | 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 "ui/views/bubble/tray_bubble_view.h" 5 #include "ui/views/bubble/tray_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (delegate_) 389 if (delegate_)
390 delegate_->OnMouseEnteredView(); 390 delegate_->OnMouseEnteredView();
391 } 391 }
392 392
393 void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) { 393 void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) {
394 if (delegate_) 394 if (delegate_)
395 delegate_->OnMouseExitedView(); 395 delegate_->OnMouseExitedView();
396 } 396 }
397 397
398 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) { 398 void TrayBubbleView::GetAccessibleState(ui::AccessibleViewState* state) {
399 if (params_.can_activate) { 399 if (delegate_ && params_.can_activate) {
400 state->role = ui::AccessibilityTypes::ROLE_WINDOW; 400 state->role = ui::AccessibilityTypes::ROLE_WINDOW;
401 state->name = delegate_->GetAccessibleNameForBubble(); 401 state->name = delegate_->GetAccessibleNameForBubble();
402 } 402 }
403 } 403 }
404 404
405 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { 405 void TrayBubbleView::ChildPreferredSizeChanged(View* child) {
406 SizeToContents(); 406 SizeToContents();
407 } 407 }
408 408
409 void TrayBubbleView::ViewHierarchyChanged( 409 void TrayBubbleView::ViewHierarchyChanged(
410 const ViewHierarchyChangedDetails& details) { 410 const ViewHierarchyChangedDetails& details) {
411 if (get_use_acceleration_when_possible() && details.is_add && 411 if (get_use_acceleration_when_possible() && details.is_add &&
412 details.child == this) { 412 details.child == this) {
413 details.parent->SetPaintToLayer(true); 413 details.parent->SetPaintToLayer(true);
414 details.parent->SetFillsBoundsOpaquely(true); 414 details.parent->SetFillsBoundsOpaquely(true);
415 details.parent->layer()->SetMasksToBounds(true); 415 details.parent->layer()->SetMasksToBounds(true);
416 } 416 }
417 } 417 }
418 418
419 } // namespace views 419 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698