summaryrefslogtreecommitdiffstats
path: root/ui/aura/client/user_action_client.h
blob: 16f0b9ff09d77ac4b42925083d11997f2416e130 (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
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2012 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_AURA_CLIENT_USER_ACTION_CLIENT_H_
#define UI_AURA_CLIENT_USER_ACTION_CLIENT_H_

#include "ui/aura/aura_export.h"

namespace aura {
class RootWindow;
namespace client {

// An interface for handling a user action that isn't handled by the standard
// event path.
class AURA_EXPORT UserActionClient {
 public:
  enum Command {
    BACK = 0,
    FORWARD,
  };

  // Returns true if the command was handled and false otherwise.
  virtual bool OnUserAction(Command command) = 0;

  virtual ~UserActionClient() {}
};

// Sets/gets the client for handling user action on the specified root window.
AURA_EXPORT void SetUserActionClient(RootWindow* root_window,
                                     UserActionClient* client);
AURA_EXPORT UserActionClient* GetUserActionClient(RootWindow* root_window);

}  // namespace client
}  // namespace aura

#endif  // UI_AURA_CLIENT_USER_ACTION_CLIENT_H_