| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/menu/submenu_view.h" | 5 #include "views/controls/menu/submenu_view.h" |
| 6 | 6 |
| 7 #include "gfx/canvas.h" | 7 #include "gfx/canvas.h" |
| 8 #include "views/controls/menu/menu_config.h" | 8 #include "views/controls/menu/menu_config.h" |
| 9 #include "views/controls/menu/menu_controller.h" | 9 #include "views/controls/menu/menu_controller.h" |
| 10 #include "views/controls/menu/menu_host.h" | 10 #include "views/controls/menu/menu_host.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 return (drop_item_ == item && drop_position_ == MenuDelegate::DROP_ON); | 305 return (drop_item_ == item && drop_position_ == MenuDelegate::DROP_ON); |
| 306 } | 306 } |
| 307 | 307 |
| 308 MenuScrollViewContainer* SubmenuView::GetScrollViewContainer() { | 308 MenuScrollViewContainer* SubmenuView::GetScrollViewContainer() { |
| 309 if (!scroll_view_container_) { | 309 if (!scroll_view_container_) { |
| 310 scroll_view_container_ = new MenuScrollViewContainer(this); | 310 scroll_view_container_ = new MenuScrollViewContainer(this); |
| 311 // Otherwise MenuHost would delete us. | 311 // Otherwise MenuHost would delete us. |
| 312 scroll_view_container_->set_parent_owned(false); | 312 scroll_view_container_->set_parent_owned(false); |
| 313 | 313 |
| 314 // Use the parent menu item accessible name for the menu view. | 314 // Use the parent menu item accessible name for the menu view. |
| 315 std::wstring accessible_name; | 315 string16 accessible_name; |
| 316 GetMenuItem()->GetAccessibleName(&accessible_name); | 316 GetMenuItem()->GetAccessibleName(&accessible_name); |
| 317 scroll_view_container_->SetAccessibleName(accessible_name); | 317 scroll_view_container_->SetAccessibleName(accessible_name); |
| 318 SetAccessibleName(accessible_name); | 318 SetAccessibleName(accessible_name); |
| 319 } | 319 } |
| 320 return scroll_view_container_; | 320 return scroll_view_container_; |
| 321 } | 321 } |
| 322 | 322 |
| 323 gfx::NativeWindow SubmenuView::native_window() const { | 323 gfx::NativeWindow SubmenuView::native_window() const { |
| 324 return host_ ? host_->GetMenuHostWindow() : NULL; | 324 return host_ ? host_->GetMenuHostWindow() : NULL; |
| 325 } | 325 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 item_bounds.set_height(kDropIndicatorHeight); | 373 item_bounds.set_height(kDropIndicatorHeight); |
| 374 return item_bounds; | 374 return item_bounds; |
| 375 | 375 |
| 376 default: | 376 default: |
| 377 // Don't render anything for on. | 377 // Don't render anything for on. |
| 378 return gfx::Rect(); | 378 return gfx::Rect(); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace views | 382 } // namespace views |
| OLD | NEW |