blob: c6a3a4e73f026d66f4459d9ddb911a07955aca41 [file] [log] [blame]
[email protected]b46442d7e2011-06-29 02:16:061// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]2a8a98122010-07-16 11:58:482// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]70019152012-12-19 11:44:195#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_
6#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_
[email protected]2a8a98122010-07-16 11:58:487
avie4d7b6f2015-12-26 00:59:188#include <stddef.h>
9
dchengb8eac3a2016-04-13 02:03:2310#include <memory>
11
[email protected]c934c382013-11-01 00:36:0112#include "base/strings/string16.h"
13
14struct DevToolsToggleAction {
15 public:
16 enum Type {
17 kShow,
einbinderdfa567b2016-12-16 01:15:5218 kShowConsolePanel,
19 kShowElementsPanel,
Pavel Feldmand10d4602018-12-13 23:52:2220 kPauseInDebugger,
[email protected]c934c382013-11-01 00:36:0121 kInspect,
22 kToggle,
[email protected]b9c5d50b2014-01-16 20:37:4323 kReveal,
24 kNoOp
[email protected]c934c382013-11-01 00:36:0125 };
26
27 struct RevealParams {
28 RevealParams(const base::string16& url,
29 size_t line_number,
30 size_t column_number);
31 ~RevealParams();
32
33 base::string16 url;
34 size_t line_number;
35 size_t column_number;
36 };
37
38 void operator=(const DevToolsToggleAction& rhs);
39 DevToolsToggleAction(const DevToolsToggleAction& rhs);
40 ~DevToolsToggleAction();
41
42 static DevToolsToggleAction Show();
einbinderdfa567b2016-12-16 01:15:5243 static DevToolsToggleAction ShowConsolePanel();
44 static DevToolsToggleAction ShowElementsPanel();
Pavel Feldmand10d4602018-12-13 23:52:2245 static DevToolsToggleAction PauseInDebugger();
[email protected]c934c382013-11-01 00:36:0146 static DevToolsToggleAction Inspect();
47 static DevToolsToggleAction Toggle();
48 static DevToolsToggleAction Reveal(const base::string16& url,
49 size_t line_number,
50 size_t column_number);
[email protected]b9c5d50b2014-01-16 20:37:4351 static DevToolsToggleAction NoOp();
[email protected]c934c382013-11-01 00:36:0152
53 Type type() const { return type_; }
54 const RevealParams* params() const { return params_.get(); }
55
56 private:
57 explicit DevToolsToggleAction(Type type);
58 explicit DevToolsToggleAction(RevealParams* reveal_params);
59
60 // The type of action.
61 Type type_;
62
63 // Additional parameters for the Reveal action; NULL if of any other type.
dchengb8eac3a2016-04-13 02:03:2364 std::unique_ptr<RevealParams> params_;
[email protected]2a8a98122010-07-16 11:58:4865};
66
[email protected]70019152012-12-19 11:44:1967#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_