diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-15 12:27:03 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-15 12:27:03 +0000 |
commit | 1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf (patch) | |
tree | b78be07dbada3ac0f6d2435558e4a6aaba198ffc /chrome/views/menu.h | |
parent | ea15e98a9353494df754a11fb49f0e4b8c0d4789 (diff) | |
download | chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.zip chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.gz chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.bz2 |
Large patch set (159 files total) to cleanup the includes.
- Slightly reduce the size of the generated .lib files ~3%.
- Reduce the number of implicit and explicit atl and windows includes. hooray!
- Help incremental build by reducing the number of unnecessary included files.
- Split some template class in two, one base class for the common code and the specialization that inherits from the base class.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/menu.h')
-rw-r--r-- | chrome/views/menu.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/chrome/views/menu.h b/chrome/views/menu.h index 44a69c2..07f00b1 100644 --- a/chrome/views/menu.h +++ b/chrome/views/menu.h @@ -27,18 +27,17 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_VIEWS_MENU_H__ -#define CHROME_VIEWS_MENU_H__ +#ifndef CHROME_VIEWS_MENU_H_ +#define CHROME_VIEWS_MENU_H_ + +#include <windows.h> -#include <atlbase.h> -#include <atlapp.h> -#include <atlmisc.h> #include <vector> -#include "base/message_loop.h" -#include "chrome/common/l10n_util.h" +#include "base/basictypes.h" #include "chrome/views/controller.h" -#include "skia/include/SkBitmap.h" + +class SkBitmap; namespace { class MenuHostWindow; @@ -70,6 +69,8 @@ class Menu { ///////////////////////////////////////////////////////////////////////////// class Delegate : public Controller { public: + virtual ~Delegate() { } + // Whether or not an item should be shown as checked. virtual bool IsItemChecked(int id) const { return false; @@ -139,9 +140,7 @@ class Menu { // is a right-to-left menu only if the view's layout is right-to-left // (since the view can use a different layout than the locale's language // layout). - virtual bool IsRightToLeftUILayout() const { - return l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT; - } + virtual bool IsRightToLeftUILayout() const; // Controller virtual bool SupportsCommand(int id) const { @@ -159,11 +158,7 @@ class Menu { protected: // Returns an empty icon. Will initialize kEmptyIcon if it hasn't been // initialized. - const SkBitmap& GetEmptyIcon() const { - if (kEmptyIcon == NULL) - kEmptyIcon = new SkBitmap(); - return *kEmptyIcon; - } + const SkBitmap& GetEmptyIcon() const; private: // Will be initialized to an icon of 0 width and 0 height when first using. @@ -200,7 +195,7 @@ class Menu { // actions to. Controller* controller_; - DISALLOW_EVIL_CONSTRUCTORS(BaseControllerDelegate); + DISALLOW_COPY_AND_ASSIGN(BaseControllerDelegate); }; // How this popup should align itself relative to the point it is run at. @@ -217,13 +212,6 @@ class Menu { SEPARATOR }; - // The data of menu items needed to display. - struct ItemData { - std::wstring label; - SkBitmap icon; - bool submenu; - }; - // Construct a Menu using the specified controller to determine command // state. // delegate A Menu::Delegate implementation that provides more @@ -324,6 +312,9 @@ class Menu { Delegate* delegate_; private: + // The data of menu items needed to display. + struct ItemData; + explicit Menu(Menu* parent); void AddMenuItemInternal(int index, @@ -378,7 +369,7 @@ class Menu { // Whether the menu is visible. bool is_menu_visible_; - DISALLOW_EVIL_CONSTRUCTORS(Menu); + DISALLOW_COPY_AND_ASSIGN(Menu); }; -#endif // CHROME_VIEWS_MENU_H__ +#endif // CHROME_VIEWS_MENU_H_ |