| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 | 11 |
| 12 struct DevToolsToggleAction { | 12 struct DevToolsToggleAction { |
| 13 public: | 13 public: |
| 14 enum Type { | 14 enum Type { |
| 15 kShow, | 15 kShow, |
| 16 kShowConsole, | 16 kShowConsole, |
| 17 kShowSecurityPanel, |
| 17 kInspect, | 18 kInspect, |
| 18 kToggle, | 19 kToggle, |
| 19 kReveal, | 20 kReveal, |
| 20 kNoOp | 21 kNoOp |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 struct RevealParams { | 24 struct RevealParams { |
| 24 RevealParams(const base::string16& url, | 25 RevealParams(const base::string16& url, |
| 25 size_t line_number, | 26 size_t line_number, |
| 26 size_t column_number); | 27 size_t column_number); |
| 27 ~RevealParams(); | 28 ~RevealParams(); |
| 28 | 29 |
| 29 base::string16 url; | 30 base::string16 url; |
| 30 size_t line_number; | 31 size_t line_number; |
| 31 size_t column_number; | 32 size_t column_number; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 void operator=(const DevToolsToggleAction& rhs); | 35 void operator=(const DevToolsToggleAction& rhs); |
| 35 DevToolsToggleAction(const DevToolsToggleAction& rhs); | 36 DevToolsToggleAction(const DevToolsToggleAction& rhs); |
| 36 ~DevToolsToggleAction(); | 37 ~DevToolsToggleAction(); |
| 37 | 38 |
| 38 static DevToolsToggleAction Show(); | 39 static DevToolsToggleAction Show(); |
| 39 static DevToolsToggleAction ShowConsole(); | 40 static DevToolsToggleAction ShowConsole(); |
| 41 static DevToolsToggleAction ShowSecurityPanel(); |
| 40 static DevToolsToggleAction Inspect(); | 42 static DevToolsToggleAction Inspect(); |
| 41 static DevToolsToggleAction Toggle(); | 43 static DevToolsToggleAction Toggle(); |
| 42 static DevToolsToggleAction Reveal(const base::string16& url, | 44 static DevToolsToggleAction Reveal(const base::string16& url, |
| 43 size_t line_number, | 45 size_t line_number, |
| 44 size_t column_number); | 46 size_t column_number); |
| 45 static DevToolsToggleAction NoOp(); | 47 static DevToolsToggleAction NoOp(); |
| 46 | 48 |
| 47 Type type() const { return type_; } | 49 Type type() const { return type_; } |
| 48 const RevealParams* params() const { return params_.get(); } | 50 const RevealParams* params() const { return params_.get(); } |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 explicit DevToolsToggleAction(Type type); | 53 explicit DevToolsToggleAction(Type type); |
| 52 explicit DevToolsToggleAction(RevealParams* reveal_params); | 54 explicit DevToolsToggleAction(RevealParams* reveal_params); |
| 53 | 55 |
| 54 // The type of action. | 56 // The type of action. |
| 55 Type type_; | 57 Type type_; |
| 56 | 58 |
| 57 // Additional parameters for the Reveal action; NULL if of any other type. | 59 // Additional parameters for the Reveal action; NULL if of any other type. |
| 58 scoped_ptr<RevealParams> params_; | 60 scoped_ptr<RevealParams> params_; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ | 63 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TOGGLE_ACTION_H_ |
| OLD | NEW |