| 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 kShowSecurityPanel, | 20 kShowSecurityPanel, |
| 20 kInspect, | 21 kInspect, |
| 21 kToggle, | 22 kToggle, |
| 22 kReveal, | 23 kReveal, |
| 23 kNoOp | 24 kNoOp |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 struct RevealParams { | 27 struct RevealParams { |
| 27 RevealParams(const base::string16& url, | 28 RevealParams(const base::string16& url, |
| 28 size_t line_number, | 29 size_t line_number, |
| 29 size_t column_number); | 30 size_t column_number); |
| 30 ~RevealParams(); | 31 ~RevealParams(); |
| 31 | 32 |
| 32 base::string16 url; | 33 base::string16 url; |
| 33 size_t line_number; | 34 size_t line_number; |
| 34 size_t column_number; | 35 size_t column_number; |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 void operator=(const DevToolsToggleAction& rhs); | 38 void operator=(const DevToolsToggleAction& rhs); |
| 38 DevToolsToggleAction(const DevToolsToggleAction& rhs); | 39 DevToolsToggleAction(const DevToolsToggleAction& rhs); |
| 39 ~DevToolsToggleAction(); | 40 ~DevToolsToggleAction(); |
| 40 | 41 |
| 41 static DevToolsToggleAction Show(); | 42 static DevToolsToggleAction Show(); |
| 42 static DevToolsToggleAction ShowConsole(); | 43 static DevToolsToggleAction ShowConsolePanel(); |
| 44 static DevToolsToggleAction ShowElementsPanel(); |
| 43 static DevToolsToggleAction ShowSecurityPanel(); | 45 static DevToolsToggleAction ShowSecurityPanel(); |
| 44 static DevToolsToggleAction Inspect(); | 46 static DevToolsToggleAction Inspect(); |
| 45 static DevToolsToggleAction Toggle(); | 47 static DevToolsToggleAction Toggle(); |
| 46 static DevToolsToggleAction Reveal(const base::string16& url, | 48 static DevToolsToggleAction Reveal(const base::string16& url, |
| 47 size_t line_number, | 49 size_t line_number, |
| 48 size_t column_number); | 50 size_t column_number); |
| 49 static DevToolsToggleAction NoOp(); | 51 static DevToolsToggleAction NoOp(); |
| 50 | 52 |
| 51 Type type() const { return type_; } | 53 Type type() const { return type_; } |
| 52 const RevealParams* params() const { return params_.get(); } | 54 const RevealParams* params() const { return params_.get(); } |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 explicit DevToolsToggleAction(Type type); | 57 explicit DevToolsToggleAction(Type type); |
| 56 explicit DevToolsToggleAction(RevealParams* reveal_params); | 58 explicit DevToolsToggleAction(RevealParams* reveal_params); |
| 57 | 59 |
| 58 // The type of action. | 60 // The type of action. |
| 59 Type type_; | 61 Type type_; |
| 60 | 62 |
| 61 // Additional parameters for the Reveal action; NULL if of any other type. | 63 // Additional parameters for the Reveal action; NULL if of any other type. |
| 62 std::unique_ptr<RevealParams> params_; | 64 std::unique_ptr<RevealParams> params_; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ | 67 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| OLD | NEW |