#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/views/performance_controls/memory_saver_resource_view.h"
#include <string>
#include "base/numerics/angle_conversions.h"
#include "chrome/grit/generated_resources.h"
#include "components/performance_manager/public/features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/text/bytes_formatting.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/vector2d_f.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/flex_layout_view.h"
#include "ui/views/layout/layout_types.h"
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(
MemorySaverResourceView,
kMemorySaverResourceViewMemorySavingsElementId);
DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(
MemorySaverResourceView,
kMemorySaverResourceViewMemoryLabelElementId);
namespace {
constexpr int kMemoryLabelSizeDelta = …;
constexpr int kGaugeRadius = …;
constexpr int kStrokeWidth = …;
constexpr int kTickStrokeWidth = …;
constexpr int kBucketCount = …;
constexpr double kBucketWidthDegrees = …;
constexpr int64_t kMemorySaverChartPmf25PercentileBytes = …;
constexpr int64_t kMemorySaverChartPmf50PercentileBytes = …;
constexpr int64_t kMemorySaverChartPmf75PercentileBytes = …;
constexpr int64_t kMemorySaverChartPmf99PercentileBytes = …;
enum MemorySavingsQuartile { … };
constexpr int kQuartilesLabels[] = …;
int GetMemorySavingsQuartile(const int64_t memory_savings_bytes) { … }
class GaugeView : public views::FlexLayoutView { … };
BEGIN_METADATA(…)
}
MemorySaverResourceView::MemorySaverResourceView(
const int64_t memory_savings_bytes) { … }