| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 | 13 |
| 14 struct DevToolsToggleAction { | 14 struct DevToolsToggleAction { |
| 15 public: | 15 public: |
| 16 enum Type { | 16 enum Type { |
| 17 kShow, | 17 kShow, |
| 18 kShowConsole, | 18 kShowConsolePanel, |
| 19 kShowElementsPanel, |
| 19 kInspect, | 20 kInspect, |
| 20 kToggle, | 21 kToggle, |
| 21 kReveal, | 22 kReveal, |
| 22 kNoOp | 23 kNoOp |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 struct RevealParams { | 26 struct RevealParams { |
| 26 RevealParams(const base::string16& url, | 27 RevealParams(const base::string16& url, |
| 27 size_t line_number, | 28 size_t line_number, |
| 28 size_t column_number); | 29 size_t column_number); |
| 29 ~RevealParams(); | 30 ~RevealParams(); |
| 30 | 31 |
| 31 base::string16 url; | 32 base::string16 url; |
| 32 size_t line_number; | 33 size_t line_number; |
| 33 size_t column_number; | 34 size_t column_number; |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 void operator=(const DevToolsToggleAction& rhs); | 37 void operator=(const DevToolsToggleAction& rhs); |
| 37 DevToolsToggleAction(const DevToolsToggleAction& rhs); | 38 DevToolsToggleAction(const DevToolsToggleAction& rhs); |
| 38 ~DevToolsToggleAction(); | 39 ~DevToolsToggleAction(); |
| 39 | 40 |
| 40 static DevToolsToggleAction Show(); | 41 static DevToolsToggleAction Show(); |
| 41 static DevToolsToggleAction ShowConsole(); | 42 static DevToolsToggleAction ShowConsolePanel(); |
| 43 static DevToolsToggleAction ShowElementsPanel(); |
| 42 static DevToolsToggleAction Inspect(); | 44 static DevToolsToggleAction Inspect(); |
| 43 static DevToolsToggleAction Toggle(); | 45 static DevToolsToggleAction Toggle(); |
| 44 static DevToolsToggleAction Reveal(const base::string16& url, | 46 static DevToolsToggleAction Reveal(const base::string16& url, |
| 45 size_t line_number, | 47 size_t line_number, |
| 46 size_t column_number); | 48 size_t column_number); |
| 47 static DevToolsToggleAction NoOp(); | 49 static DevToolsToggleAction NoOp(); |
| 48 | 50 |
| 49 Type type() const { return type_; } | 51 Type type() const { return type_; } |
| 50 const RevealParams* params() const { return params_.get(); } | 52 const RevealParams* params() const { return params_.get(); } |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 explicit DevToolsToggleAction(Type type); | 55 explicit DevToolsToggleAction(Type type); |
| 54 explicit DevToolsToggleAction(RevealParams* reveal_params); | 56 explicit DevToolsToggleAction(RevealParams* reveal_params); |
| 55 | 57 |
| 56 // The type of action. | 58 // The type of action. |
| 57 Type type_; | 59 Type type_; |
| 58 | 60 |
| 59 // Additional parameters for the Reveal action; NULL if of any other type. | 61 // Additional parameters for the Reveal action; NULL if of any other type. |
| 60 std::unique_ptr<RevealParams> params_; | 62 std::unique_ptr<RevealParams> params_; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ | 65 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| OLD | NEW |