| OLD | NEW |
| 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/controls/menu/submenu_view.h" | 5 #include "ui/views/controls/menu/submenu_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 if (!scroll_view_container_) { | 447 if (!scroll_view_container_) { |
| 448 scroll_view_container_ = new MenuScrollViewContainer(this); | 448 scroll_view_container_ = new MenuScrollViewContainer(this); |
| 449 // Otherwise MenuHost would delete us. | 449 // Otherwise MenuHost would delete us. |
| 450 scroll_view_container_->set_owned_by_client(); | 450 scroll_view_container_->set_owned_by_client(); |
| 451 } | 451 } |
| 452 return scroll_view_container_; | 452 return scroll_view_container_; |
| 453 } | 453 } |
| 454 | 454 |
| 455 void SubmenuView::MenuHostDestroyed() { | 455 void SubmenuView::MenuHostDestroyed() { |
| 456 host_ = NULL; | 456 host_ = NULL; |
| 457 MenuController* controller = GetMenuItem()->GetMenuController(); | 457 GetMenuItem()->GetMenuController()->Cancel(MenuController::EXIT_DESTROYED); |
| 458 if (controller) | |
| 459 controller->Cancel(MenuController::EXIT_DESTROYED); | |
| 460 } | 458 } |
| 461 | 459 |
| 462 const char* SubmenuView::GetClassName() const { | 460 const char* SubmenuView::GetClassName() const { |
| 463 return kViewClassName; | 461 return kViewClassName; |
| 464 } | 462 } |
| 465 | 463 |
| 466 void SubmenuView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 464 void SubmenuView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 467 SchedulePaint(); | 465 SchedulePaint(); |
| 468 } | 466 } |
| 469 | 467 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 y = std::max(y, 0); | 512 y = std::max(y, 0); |
| 515 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); | 513 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); |
| 516 if (new_vis_bounds != vis_bounds) { | 514 if (new_vis_bounds != vis_bounds) { |
| 517 ScrollRectToVisible(new_vis_bounds); | 515 ScrollRectToVisible(new_vis_bounds); |
| 518 return true; | 516 return true; |
| 519 } | 517 } |
| 520 return false; | 518 return false; |
| 521 } | 519 } |
| 522 | 520 |
| 523 } // namespace views | 521 } // namespace views |
| OLD | NEW |