summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 15:25:18 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-27 15:25:18 +0000
commit30dfbcd9b288b4c374d59fe9a71dda1cf28c085e (patch)
treef390887eb57d918e4a8579627f8f3899ce6df866 /ui/views/controls
parent75d488fd44ddebabbd292cdd013f2b5a012a8b47 (diff)
downloadchromium_src-30dfbcd9b288b4c374d59fe9a71dda1cf28c085e.zip
chromium_src-30dfbcd9b288b4c374d59fe9a71dda1cf28c085e.tar.gz
chromium_src-30dfbcd9b288b4c374d59fe9a71dda1cf28c085e.tar.bz2
views: Make MenuWrapper do not depend on deprecated Menu2 API.
R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10221012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/menu/menu_2.cc4
-rw-r--r--ui/views/controls/menu/menu_wrapper.h13
-rw-r--r--ui/views/controls/menu/native_menu_win.cc4
3 files changed, 12 insertions, 9 deletions
diff --git a/ui/views/controls/menu/menu_2.cc b/ui/views/controls/menu/menu_2.cc
index d9aad1e..c93b5a7 100644
--- a/ui/views/controls/menu/menu_2.cc
+++ b/ui/views/controls/menu/menu_2.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,7 +12,7 @@ namespace views {
Menu2::Menu2(ui::MenuModel* model)
: model_(model),
ALLOW_THIS_IN_INITIALIZER_LIST(
- wrapper_(MenuWrapper::CreateWrapper(this))) {
+ wrapper_(MenuWrapper::CreateWrapper(model))) {
Rebuild();
}
diff --git a/ui/views/controls/menu/menu_wrapper.h b/ui/views/controls/menu/menu_wrapper.h
index 4975ebf..50edfdb 100644
--- a/ui/views/controls/menu/menu_wrapper.h
+++ b/ui/views/controls/menu/menu_wrapper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,9 +13,12 @@ namespace gfx {
class Point;
}
+namespace ui {
+class MenuModel;
+}
+
namespace views {
-class Menu2;
class MenuListener;
// An interface that wraps an object that implements a menu.
@@ -31,6 +34,9 @@ class VIEWS_EXPORT MenuWrapper {
virtual ~MenuWrapper() {}
+ // Creates the appropriate instance of this wrapper for the current platform.
+ static MenuWrapper* CreateWrapper(ui::MenuModel* model);
+
// Runs the menu at the specified point. This blocks until done.
virtual void RunMenuAt(const gfx::Point& point, int alignment) = 0;
@@ -61,9 +67,6 @@ class VIEWS_EXPORT MenuWrapper {
// Sets the minimum width of the menu.
virtual void SetMinimumWidth(int width) = 0;
-
- // Creates the appropriate instance of this wrapper for the current platform.
- static MenuWrapper* CreateWrapper(Menu2* menu);
};
} // namespace views
diff --git a/ui/views/controls/menu/native_menu_win.cc b/ui/views/controls/menu/native_menu_win.cc
index 1d518ea..7df8c8c 100644
--- a/ui/views/controls/menu/native_menu_win.cc
+++ b/ui/views/controls/menu/native_menu_win.cc
@@ -743,8 +743,8 @@ void NativeMenuWin::CreateHostWindow() {
// MenuWrapper, public:
// static
-MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) {
- return new NativeMenuWin(menu->model(), NULL);
+MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) {
+ return new NativeMenuWin(model, NULL);
}
} // namespace views