Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11199)

Unified Diff: headless/public/web_frame.h

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fine, no console logging Mr. Presubmit. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/public/web_contents.h ('k') | headless/test/data/hello.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/web_frame.h
diff --git a/headless/public/web_frame.h b/headless/public/web_frame.h
deleted file mode 100644
index c8e5307180cc218e6b92f725c0d3e7dbb487966f..0000000000000000000000000000000000000000
--- a/headless/public/web_frame.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef HEADLESS_PUBLIC_WEB_FRAME_H_
-#define HEADLESS_PUBLIC_WEB_FRAME_H_
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/values.h"
-#include "headless/public/headless_export.h"
-
-namespace headless {
-
-class WebDocument;
-
-// Class representing a frame in a web page (e.g. main frame or an iframe).
-// Should be accessed from renderer main thread.
-class HEADLESS_EXPORT WebFrame {
- public:
- virtual ~WebFrame() {}
-
- using ScriptExecutionCallback =
- base::Callback<void(const std::vector<scoped_ptr<base::Value>>&)>;
-
- // Schedule given script for execution.
- virtual void ExecuteScript(const std::string& source_code) = 0;
-
- // Execute given script and return its result.
- // Returned value will be converted to json (base::Value).
- // Special effects to bear in mind:
- // - Boolean will be converted to base::FundamentalValue (no surprises here).
- // - Number will be converted to base::FundamentalValue.
- // - Array will be converted to base::ListValue.
- // Note: All non-numerical properties will be omitted
- // (e.g. "array = [1, 2, 3]; array['property'] = 'value'; return array"
- // will return [1, 2, 3]).
- // - Object will be converted to base::DictionaryValue
- // Note: Only string can be key in base::DictionaryValue, so all non-string
- // properties will be omitted
- // (e.g. "obj = Object(); obj['key'] = 'value'; obj[0] = 42;" will return
- // {"key":"value"}).
- virtual void ExecuteScriptAndReturnValue(
- const std::string& source_code,
- const ScriptExecutionCallback& callback) = 0;
-
- virtual std::string ContentAsText(size_t max_chars) const = 0;
- virtual std::string ContentAsMarkup() const = 0;
- virtual proto::Document ContentAsProtobuf() const = 0;
-
- virtual gfx::Size GetScrollOffset() const = 0;
- virtual void SetScrollOffset(const gfx::Size& offset) = 0;
-
- virtual float GetPageScaleFactor() const = 0;
- virtual void SetPageScaleFactor(float page_scale_factor) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WebFrame);
-};
-
-} // namespace headless
-
-#endif // HEADLESS_PUBLIC_WEB_FRAME_H_
« no previous file with comments | « headless/public/web_contents.h ('k') | headless/test/data/hello.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698