[email protected] | b46442d7e | 2011-06-29 02:16:06 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 2a8a9812 | 2010-07-16 11:58:48 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 7001915 | 2012-12-19 11:44:19 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| 6 | #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
[email protected] | 2a8a9812 | 2010-07-16 11:58:48 | [diff] [blame] | 7 | |
avi | e4d7b6f | 2015-12-26 00:59:18 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | |
dcheng | b8eac3a | 2016-04-13 02:03:23 | [diff] [blame] | 10 | #include <memory> |
| 11 | |
[email protected] | c934c38 | 2013-11-01 00:36:01 | [diff] [blame] | 12 | #include "base/strings/string16.h" |
| 13 | |
| 14 | struct DevToolsToggleAction { |
| 15 | public: |
| 16 | enum Type { |
| 17 | kShow, |
einbinder | dfa567b | 2016-12-16 01:15:52 | [diff] [blame] | 18 | kShowConsolePanel, |
| 19 | kShowElementsPanel, |
Pavel Feldman | d10d460 | 2018-12-13 23:52:22 | [diff] [blame] | 20 | kPauseInDebugger, |
[email protected] | c934c38 | 2013-11-01 00:36:01 | [diff] [blame] | 21 | kInspect, |
| 22 | kToggle, |
[email protected] | b9c5d50b | 2014-01-16 20:37:43 | [diff] [blame] | 23 | kReveal, |
| 24 | kNoOp |
[email protected] | c934c38 | 2013-11-01 00:36:01 | [diff] [blame] | 25 | }; |
| 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(); |
einbinder | dfa567b | 2016-12-16 01:15:52 | [diff] [blame] | 43 | static DevToolsToggleAction ShowConsolePanel(); |
| 44 | static DevToolsToggleAction ShowElementsPanel(); |
Pavel Feldman | d10d460 | 2018-12-13 23:52:22 | [diff] [blame] | 45 | static DevToolsToggleAction PauseInDebugger(); |
[email protected] | c934c38 | 2013-11-01 00:36:01 | [diff] [blame] | 46 | 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] | b9c5d50b | 2014-01-16 20:37:43 | [diff] [blame] | 51 | static DevToolsToggleAction NoOp(); |
[email protected] | c934c38 | 2013-11-01 00:36:01 | [diff] [blame] | 52 | |
| 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. |
dcheng | b8eac3a | 2016-04-13 02:03:23 | [diff] [blame] | 64 | std::unique_ptr<RevealParams> params_; |
[email protected] | 2a8a9812 | 2010-07-16 11:58:48 | [diff] [blame] | 65 | }; |
| 66 | |
[email protected] | 7001915 | 2012-12-19 11:44:19 | [diff] [blame] | 67 | #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |