forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu_graph_page_view.h
41 lines (31 loc) · 1.12 KB
/
cpu_graph_page_view.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2020 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.
#ifndef ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_
#define ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_
#include "ash/hud_display/graph.h"
#include "ash/hud_display/graph_page_view_base.h"
namespace ash {
namespace hud_display {
// Draws CPU graphs;
class CpuGraphPageView : public GraphPageViewBase {
public:
METADATA_HEADER(CpuGraphPageView);
explicit CpuGraphPageView(const base::TimeDelta refresh_interval);
CpuGraphPageView(const CpuGraphPageView&) = delete;
CpuGraphPageView& operator=(const CpuGraphPageView&) = delete;
~CpuGraphPageView() override;
// views::View
void OnPaint(gfx::Canvas* canvas) override;
// Update page data from the new snapshot.
void UpdateData(const DataSource::Snapshot& snapshot) override;
private:
// Stacked, percent of CPU ticks per interval:
Graph cpu_other_;
Graph cpu_system_;
Graph cpu_user_;
Graph cpu_idle_;
};
} // namespace hud_display
} // namespace ash
#endif // ASH_HUD_DISPLAY_CPU_GRAPH_PAGE_VIEW_H_