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" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Updates the text on the menu button. | 36 // Updates the text on the menu button. |
37 void UpdateText(); | 37 void UpdateText(); |
38 | 38 |
39 protected: | 39 protected: |
40 virtual int horizontal_padding() OVERRIDE; | 40 virtual int horizontal_padding() OVERRIDE; |
41 | 41 |
42 private: | 42 private: |
43 // views::ViewMenuDelegate implementation. | 43 // views::ViewMenuDelegate implementation. |
44 virtual void RunMenu(views::View* source, const gfx::Point& pt); | 44 virtual void RunMenu(views::View* source, const gfx::Point& pt); |
45 | 45 |
46 // Execute command id for each renderer. Used for heap profiling. | |
47 void SendCommandToRenderers(int id); | |
48 | |
49 // Create and initialize menu if not already present. | 46 // Create and initialize menu if not already present. |
50 void EnsureMenu(); | 47 void EnsureMenu(); |
51 | 48 |
52 // Updates text and schedules the timer to fire at the next minute interval. | 49 // Updates text and schedules the timer to fire at the next minute interval. |
53 void UpdateTextAndSetNextTimer(); | 50 void UpdateTextAndSetNextTimer(); |
54 | 51 |
55 base::OneShotTimer<MemoryMenuButton> timer_; | 52 base::OneShotTimer<MemoryMenuButton> timer_; |
56 | 53 |
57 // NOTE: we use a scoped_ptr here as menu calls into 'this' from the | 54 // NOTE: we use a scoped_ptr here as menu calls into 'this' from the |
58 // constructor. | 55 // constructor. |
59 scoped_ptr<views::MenuItemView> menu_; | 56 scoped_ptr<views::MenuItemView> menu_; |
60 | 57 |
61 int mem_total_; | 58 int mem_total_; |
62 int shmem_; // video driver memory, hidden from OS | 59 int shmem_; // video driver memory, hidden from OS |
63 int mem_free_; | 60 int mem_free_; |
64 int mem_buffers_; | 61 int mem_buffers_; |
65 int mem_cache_; | 62 int mem_cache_; |
66 | 63 |
67 DISALLOW_COPY_AND_ASSIGN(MemoryMenuButton); | 64 DISALLOW_COPY_AND_ASSIGN(MemoryMenuButton); |
68 }; | 65 }; |
69 | 66 |
70 } // namespace chromeos | 67 } // namespace chromeos |
71 | 68 |
72 #endif // CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ | 69 #endif // CHROME_BROWSER_CHROMEOS_STATUS_MEMORY_MENU_BUTTON_H_ |
OLD | NEW |