diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 03:55:44 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 03:55:44 +0000 |
commit | 1075eb663efb29c18e8e87f74d1293ee27fb324d (patch) | |
tree | 92096a628d1dd4c799db901bd59fdb1c9bacedbd /views/controls/menu/menu.h | |
parent | a0421736a8a437ff97eb7deb6050f08b75810343 (diff) | |
download | chromium_src-1075eb663efb29c18e8e87f74d1293ee27fb324d.zip chromium_src-1075eb663efb29c18e8e87f74d1293ee27fb324d.tar.gz chromium_src-1075eb663efb29c18e8e87f74d1293ee27fb324d.tar.bz2 |
views: Remove Controller interface.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6532083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu.h')
-rw-r--r-- | views/controls/menu/menu.h | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/views/controls/menu/menu.h b/views/controls/menu/menu.h index e3bb49b..6699461 100644 --- a/views/controls/menu/menu.h +++ b/views/controls/menu/menu.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,11 +6,13 @@ #define CONTROLS_MENU_VIEWS_MENU_H_ #pragma once +#include <string> + #include "base/basictypes.h" #include "ui/gfx/native_widget_types.h" -#include "views/controls/menu/controller.h" class SkBitmap; + namespace gfx { class Point; } @@ -29,9 +31,9 @@ class Menu { // item as it is created. // ///////////////////////////////////////////////////////////////////////////// - class Delegate : public Controller { + class Delegate { public: - virtual ~Delegate() { } + virtual ~Delegate() {} // Whether or not an item should be shown as checked. virtual bool IsItemChecked(int id) const { @@ -121,38 +123,6 @@ class Menu { const SkBitmap& GetEmptyIcon() const; }; - // This class is a helper that simply wraps a controller and forwards all - // state and execution actions to it. Use this when you're not defining your - // own custom delegate, but just hooking a context menu to some existing - // controller elsewhere. - class BaseControllerDelegate : public Delegate { - public: - explicit BaseControllerDelegate(Controller* wrapped) - : controller_(wrapped) { - } - - // Overridden from Menu::Delegate - virtual bool SupportsCommand(int id) const { - return controller_->SupportsCommand(id); - } - virtual bool IsCommandEnabled(int id) const { - return controller_->IsCommandEnabled(id); - } - virtual void ExecuteCommand(int id) { - controller_->ExecuteCommand(id); - } - virtual bool GetContextualLabel(int id, std::wstring* out) const { - return controller_->GetContextualLabel(id, out); - } - - private: - // The internal controller that we wrap to forward state and execution - // actions to. - Controller* controller_; - - DISALLOW_COPY_AND_ASSIGN(BaseControllerDelegate); - }; - // How this popup should align itself relative to the point it is run at. enum AnchorPoint { TOPLEFT, |