OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 HEADLESS_PUBLIC_WEB_FRAME_H_ | 5 #ifndef HEADLESS_PUBLIC_WEB_FRAME_H_ |
6 #define HEADLESS_PUBLIC_WEB_FRAME_H_ | 6 #define HEADLESS_PUBLIC_WEB_FRAME_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // will return [1, 2, 3]). | 37 // will return [1, 2, 3]). |
38 // - Object will be converted to base::DictionaryValue | 38 // - Object will be converted to base::DictionaryValue |
39 // Note: Only string can be key in base::DictionaryValue, so all non-string | 39 // Note: Only string can be key in base::DictionaryValue, so all non-string |
40 // properties will be omitted | 40 // properties will be omitted |
41 // (e.g. "obj = Object(); obj['key'] = 'value'; obj[0] = 42;" will return | 41 // (e.g. "obj = Object(); obj['key'] = 'value'; obj[0] = 42;" will return |
42 // {"key":"value"}). | 42 // {"key":"value"}). |
43 virtual void ExecuteScriptAndReturnValue( | 43 virtual void ExecuteScriptAndReturnValue( |
44 const std::string& source_code, | 44 const std::string& source_code, |
45 const ScriptExecutionCallback& callback) = 0; | 45 const ScriptExecutionCallback& callback) = 0; |
46 | 46 |
| 47 virtual std::string ContentAsText(size_t max_chars) const = 0; |
| 48 virtual std::string ContentAsMarkup() const = 0; |
| 49 virtual proto::Document ContentAsProtobuf() const = 0; |
| 50 |
| 51 virtual gfx::Size GetScrollOffset() const = 0; |
| 52 virtual void SetScrollOffset(const gfx::Size& offset) = 0; |
| 53 |
| 54 virtual float GetPageScaleFactor() const = 0; |
| 55 virtual void SetPageScaleFactor(float page_scale_factor) = 0; |
| 56 |
47 private: | 57 private: |
48 DISALLOW_COPY_AND_ASSIGN(WebFrame); | 58 DISALLOW_COPY_AND_ASSIGN(WebFrame); |
49 }; | 59 }; |
50 | 60 |
51 } // namespace headless | 61 } // namespace headless |
52 | 62 |
53 #endif // HEADLESS_PUBLIC_WEB_FRAME_H_ | 63 #endif // HEADLESS_PUBLIC_WEB_FRAME_H_ |
OLD | NEW |