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 "chrome/browser/chromeos/views/native_menu_domui.h" | 5 #include "chrome/browser/chromeos/views/native_menu_domui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 NativeMenuDOMUI* found = submenu_->FindMenuAt(point); | 393 NativeMenuDOMUI* found = submenu_->FindMenuAt(point); |
394 if (found) | 394 if (found) |
395 return found; | 395 return found; |
396 } | 396 } |
397 gfx::Rect bounds; | 397 gfx::Rect bounds; |
398 menu_widget_->GetBounds(&bounds, false); | 398 menu_widget_->GetBounds(&bounds, false); |
399 return bounds.Contains(point) ? this : NULL; | 399 return bounds.Contains(point) ? this : NULL; |
400 } | 400 } |
401 | 401 |
402 } // namespace chromeos | 402 } // namespace chromeos |
403 | |
404 //////////////////////////////////////////////////////////////////////////////// | |
405 // MenuWrapper, public: | |
406 | |
407 namespace views { | |
408 | |
409 // static | |
410 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { | |
411 ui::MenuModel* model = menu->model(); | |
412 if (chromeos::MenuUI::IsEnabled()) { | |
413 return new chromeos::NativeMenuDOMUI(model, true); | |
414 } else { | |
415 #if defined(TOUCH_UI) | |
416 return new NativeMenuX(menu); | |
417 #else | |
418 return new NativeMenuGtk(menu); | |
419 #endif | |
420 } | |
421 } | |
422 | |
423 } // namespace views | |
OLD | NEW |