summaryrefslogtreecommitdiff
path: root/chromium/ui/base/idle/scoped_set_idle_state.h
blob: 7309095d37b1f51dd49b0e35fa8331071ae9a0c5 (plain)
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
// Copyright 2019 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 UI_BASE_IDLE_SCOPED_SET_IDLE_STATE_H_
#define UI_BASE_IDLE_SCOPED_SET_IDLE_STATE_H_

#include "base/macros.h"
#include "base/optional.h"
#include "ui/base/idle/idle.h"

namespace ui {

class ScopedSetIdleState {
 public:
  explicit ScopedSetIdleState(IdleState state);
  ~ScopedSetIdleState();

 private:
  base::Optional<IdleState> previous_state_;

  DISALLOW_COPY_AND_ASSIGN(ScopedSetIdleState);
};

}  // namespace ui

#endif  // UI_BASE_IDLE_SCOPED_SET_IDLE_STATE_H_