OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
11 #include "chrome/browser/chromeos/status/status_area_button.h" | 11 #include "chrome/browser/chromeos/status/status_area_button.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
14 #include "views/controls/menu/menu_delegate.h" | 14 #include "views/controls/menu/menu_delegate.h" |
15 #include "views/controls/menu/view_menu_delegate.h" | 15 #include "views/controls/menu/view_menu_delegate.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 struct SystemMemoryInfoKB; | 18 struct SystemMemoryInfoKB; |
19 } | 19 } |
20 | 20 |
21 namespace views { | 21 namespace views { |
22 class MenuItemView; | 22 class MenuItemView; |
23 class MenuRunner; | 23 class MenuRunner; |
24 } | 24 } |
25 | 25 |
26 namespace chromeos { | 26 namespace chromeos { |
27 | 27 |
28 class StatusAreaHost; | |
29 | |
30 // Memory debugging display that lives in the status area. | 28 // Memory debugging display that lives in the status area. |
31 class MemoryMenuButton : public StatusAreaButton, | 29 class MemoryMenuButton : public StatusAreaButton, |
32 public views::MenuDelegate, | 30 public views::MenuDelegate, |
33 public views::ViewMenuDelegate, | 31 public views::ViewMenuDelegate, |
34 public content::NotificationObserver { | 32 public content::NotificationObserver { |
35 public: | 33 public: |
36 explicit MemoryMenuButton(StatusAreaHost* host); | 34 explicit MemoryMenuButton(StatusAreaButton::Delegate* delegate); |
37 virtual ~MemoryMenuButton(); | 35 virtual ~MemoryMenuButton(); |
38 | 36 |
39 // views::MenuDelegate implementation | 37 // views::MenuDelegate implementation |
40 virtual string16 GetLabel(int id) const OVERRIDE; | 38 virtual string16 GetLabel(int id) const OVERRIDE; |
41 virtual bool IsCommandEnabled(int id) const OVERRIDE; | 39 virtual bool IsCommandEnabled(int id) const OVERRIDE; |
42 virtual void ExecuteCommand(int id) OVERRIDE; | 40 virtual void ExecuteCommand(int id) OVERRIDE; |
43 | 41 |
44 // views::ViewMenuDelegate implementation. | 42 // views::ViewMenuDelegate implementation. |
45 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; | 43 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; |
46 | 44 |
(...skipping 29 matching lines...) Expand all Loading... |
76 int renderer_kills_; | 74 int renderer_kills_; |
77 | 75 |
78 scoped_ptr<views::MenuRunner> menu_runner_; | 76 scoped_ptr<views::MenuRunner> menu_runner_; |
79 | 77 |
80 DISALLOW_COPY_AND_ASSIGN(MemoryMenuButton); | 78 DISALLOW_COPY_AND_ASSIGN(MemoryMenuButton); |
81 }; | 79 }; |
82 | 80 |
83 } // namespace chromeos | 81 } // namespace chromeos |
84 | 82 |
85 #endif // CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ |
OLD | NEW |