summaryrefslogtreecommitdiffstats
path: root/blimp/engine
diff options
context:
space:
mode:
authorkuan <kuan@chromium.org>2015-10-07 14:29:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-07 21:29:55 +0000
commitb4738da24a84691c302d2dfdf4aad772d44d5a63 (patch)
tree155679000d22ba4acb771d413284a331866a0d16 /blimp/engine
parentbdf351e541afa34f8fcf178a7f86ea548d436f6f (diff)
downloadchromium_src-b4738da24a84691c302d2dfdf4aad772d44d5a63.zip
chromium_src-b4738da24a84691c302d2dfdf4aad772d44d5a63.tar.gz
chromium_src-b4738da24a84691c302d2dfdf4aad772d44d5a63.tar.bz2
Revert of [Blimp] Adds a headless content shell as a blimp engine. It uses a dummy screen, and is a slimming … (patchset #11 id:200001 of https://codereview.chromium.org/1364463003/ )
Reason for revert: broke build: http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20Clobber/builds/6346 Original issue's description: > [Blimp] Adds a headless content shell as a blimp engine. It uses a dummy screen, and is a slimming down version of the content shell. > It loads google.com as the initial URL. > > BUG=533592 > > Committed: https://crrev.com/ce6219fba3471bb7b4d295127eb34e734d14f499 > Cr-Commit-Position: refs/heads/master@{#352902} TBR=wez@chromium.org,dtrainor@chromium.org,davidben@chromium.org,sky@chromium.org,mark@chromium.org,haibinlu@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=533592 Review URL: https://codereview.chromium.org/1397613002 Cr-Commit-Position: refs/heads/master@{#352949}
Diffstat (limited to 'blimp/engine')
-rw-r--r--blimp/engine/BUILD.gn61
-rw-r--r--blimp/engine/DEPS10
-rw-r--r--blimp/engine/app/BUILD.gn19
-rw-r--r--blimp/engine/app/blimp_content_main_delegate.cc53
-rw-r--r--blimp/engine/app/blimp_content_main_delegate.h43
-rw-r--r--blimp/engine/app/blimp_main.cc14
-rw-r--r--blimp/engine/browser/BUILD.gn34
-rw-r--r--blimp/engine/browser/blimp_browser_context.cc170
-rw-r--r--blimp/engine/browser/blimp_browser_context.h79
-rw-r--r--blimp/engine/browser/blimp_browser_main_parts.cc61
-rw-r--r--blimp/engine/browser/blimp_browser_main_parts.h45
-rw-r--r--blimp/engine/browser/blimp_content_browser_client.cc39
-rw-r--r--blimp/engine/browser/blimp_content_browser_client.h42
-rw-r--r--blimp/engine/browser/blimp_network_delegate.cc51
-rw-r--r--blimp/engine/browser/blimp_network_delegate.h38
-rw-r--r--blimp/engine/browser/blimp_permission_manager.cc58
-rw-r--r--blimp/engine/browser/blimp_permission_manager.h52
-rw-r--r--blimp/engine/browser/blimp_url_request_context_getter.cc224
-rw-r--r--blimp/engine/browser/blimp_url_request_context_getter.h78
-rw-r--r--blimp/engine/browser/blimp_window.cc140
-rw-r--r--blimp/engine/browser/blimp_window.h79
-rw-r--r--blimp/engine/common/BUILD.gn16
-rw-r--r--blimp/engine/common/blimp_content_client.cc50
-rw-r--r--blimp/engine/common/blimp_content_client.h35
-rw-r--r--blimp/engine/renderer/BUILD.gn15
-rw-r--r--blimp/engine/renderer/blimp_content_renderer_client.cc23
-rw-r--r--blimp/engine/renderer/blimp_content_renderer_client.h37
-rw-r--r--blimp/engine/ui/BUILD.gn14
-rw-r--r--blimp/engine/ui/blimp_screen.cc77
-rw-r--r--blimp/engine/ui/blimp_screen.h47
30 files changed, 6 insertions, 1698 deletions
diff --git a/blimp/engine/BUILD.gn b/blimp/engine/BUILD.gn
index ecc1f61..849b3ce 100644
--- a/blimp/engine/BUILD.gn
+++ b/blimp/engine/BUILD.gn
@@ -2,65 +2,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//build/config/features.gni")
-import("//build/config/sanitizers/sanitizers.gni")
-import("//build/config/ui.gni")
-import("//tools/grit/repack.gni")
-import("//tools/grit/grit_rule.gni")
-
-repack("pak") {
- sources = [
- "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
- "$root_gen_dir/blink/public/resources/blink_resources.pak",
- "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
- "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
- "$root_gen_dir/content/content_resources.pak",
- "$root_gen_dir/net/net_resources.pak",
- "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
- "$root_gen_dir/ui/resources/webui_resources.pak",
- "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
- "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
- ]
-
- deps = [
- "//content:resources",
- "//content/app/resources",
- "//content/app/strings",
- "//content/browser/tracing:resources",
- "//net:net_resources",
- "//third_party/WebKit/public:image_resources",
- "//third_party/WebKit/public:resources",
- "//ui/resources",
- "//ui/strings",
- ]
-
- if (toolkit_views) {
- deps += [ "//ui/views/resources" ]
- sources +=
- [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ]
- }
-
- output = "$root_out_dir/blimp_engine.pak"
-}
-
if (is_linux) {
- executable("blimp_engine_app") {
- sources = [
- "app/blimp_main.cc",
- ]
-
- deps = [
- ":pak",
- "//blimp/engine/app",
- ]
- }
-
# A stand-in for the Blimp Engine so we can get the Docker packaging working.
+ #
+ # TODO(maniscalco): Update to use the real engine once it's ready and remove
+ # the testonly attribute (crbug.com/538353).
group("blimp_engine") {
+ testonly = true
data_deps = [
- ":blimp_engine_app",
- ":pak",
+ "//content/shell:content_shell",
+ "//content/shell:pak",
]
}
}
diff --git a/blimp/engine/DEPS b/blimp/engine/DEPS
deleted file mode 100644
index 0d8bb18..0000000
--- a/blimp/engine/DEPS
+++ /dev/null
@@ -1,10 +0,0 @@
-include_rules = [
- "+base",
- "-chrome",
- "+components/web_cache/renderer",
- "+content/public",
- "+net",
- "+ui/base",
- "+ui/resources",
- "+ui/gfx",
-]
diff --git a/blimp/engine/app/BUILD.gn b/blimp/engine/app/BUILD.gn
deleted file mode 100644
index 48fb025..0000000
--- a/blimp/engine/app/BUILD.gn
+++ /dev/null
@@ -1,19 +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.
-
-source_set("app") {
- sources = [
- "blimp_content_main_delegate.cc",
- "blimp_content_main_delegate.h",
- ]
-
- deps = [
- "//base",
- "//blimp/engine/browser",
- "//blimp/engine/common",
- "//blimp/engine/renderer",
- "//content/public/app:both",
- "//ui/base",
- ]
-}
diff --git a/blimp/engine/app/blimp_content_main_delegate.cc b/blimp/engine/app/blimp_content_main_delegate.cc
deleted file mode 100644
index a3efeff..0000000
--- a/blimp/engine/app/blimp_content_main_delegate.cc
+++ /dev/null
@@ -1,53 +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.
-
-#include "blimp/engine/app/blimp_content_main_delegate.h"
-
-#include "base/files/file.h"
-#include "base/files/file_path.h"
-#include "base/path_service.h"
-#include "blimp/engine/browser/blimp_content_browser_client.h"
-#include "blimp/engine/renderer/blimp_content_renderer_client.h"
-#include "ui/base/resource/resource_bundle.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpContentMainDelegate::BlimpContentMainDelegate() {}
-
-BlimpContentMainDelegate::~BlimpContentMainDelegate() {}
-
-bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) {
- content::SetContentClient(&content_client_);
- return false;
-}
-
-void BlimpContentMainDelegate::PreSandboxStartup() {
- InitializeResourceBundle();
-}
-
-void BlimpContentMainDelegate::InitializeResourceBundle() {
- base::FilePath pak_file;
- bool pak_file_valid = PathService::Get(base::DIR_MODULE, &pak_file);
- CHECK(pak_file_valid);
- pak_file = pak_file.Append(FILE_PATH_LITERAL("blimp_engine.pak"));
- ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
-}
-
-content::ContentBrowserClient*
-BlimpContentMainDelegate::CreateContentBrowserClient() {
- DCHECK(!browser_client_);
- browser_client_.reset(new BlimpContentBrowserClient);
- return browser_client_.get();
-}
-
-content::ContentRendererClient*
-BlimpContentMainDelegate::CreateContentRendererClient() {
- DCHECK(!renderer_client_);
- renderer_client_.reset(new BlimpContentRendererClient);
- return renderer_client_.get();
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/app/blimp_content_main_delegate.h b/blimp/engine/app/blimp_content_main_delegate.h
deleted file mode 100644
index 24aa4c3..0000000
--- a/blimp/engine/app/blimp_content_main_delegate.h
+++ /dev/null
@@ -1,43 +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 BLIMP_ENGINE_APP_BLIMP_CONTENT_MAIN_DELEGATE_H_
-#define BLIMP_ENGINE_APP_BLIMP_CONTENT_MAIN_DELEGATE_H_
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "blimp/engine/common/blimp_content_client.h"
-#include "content/public/app/content_main_delegate.h"
-
-namespace blimp {
-namespace engine {
-
-class BlimpContentBrowserClient;
-class BlimpContentRendererClient;
-
-class BlimpContentMainDelegate : public content::ContentMainDelegate {
- public:
- BlimpContentMainDelegate();
- ~BlimpContentMainDelegate() override;
-
- // content::ContentMainDelegate implementation.
- bool BasicStartupComplete(int* exit_code) override;
- void PreSandboxStartup() override;
- content::ContentBrowserClient* CreateContentBrowserClient() override;
- content::ContentRendererClient* CreateContentRendererClient() override;
-
- private:
- void InitializeResourceBundle();
-
- scoped_ptr<BlimpContentBrowserClient> browser_client_;
- scoped_ptr<BlimpContentRendererClient> renderer_client_;
- BlimpContentClient content_client_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpContentMainDelegate);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_APP_BLIMP_CONTENT_MAIN_DELEGATE_H_
diff --git a/blimp/engine/app/blimp_main.cc b/blimp/engine/app/blimp_main.cc
deleted file mode 100644
index 64e3e53..0000000
--- a/blimp/engine/app/blimp_main.cc
+++ /dev/null
@@ -1,14 +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.
-
-#include "blimp/engine/app/blimp_content_main_delegate.h"
-#include "content/public/app/content_main.h"
-
-int main(int argc, const char** argv) {
- blimp::engine::BlimpContentMainDelegate delegate;
- content::ContentMainParams params(&delegate);
- params.argc = argc;
- params.argv = argv;
- return content::ContentMain(params);
-}
diff --git a/blimp/engine/browser/BUILD.gn b/blimp/engine/browser/BUILD.gn
deleted file mode 100644
index dc7ac4a..0000000
--- a/blimp/engine/browser/BUILD.gn
+++ /dev/null
@@ -1,34 +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.
-
-source_set("browser") {
- sources = [
- "blimp_browser_context.cc",
- "blimp_browser_context.h",
- "blimp_browser_main_parts.cc",
- "blimp_browser_main_parts.h",
- "blimp_content_browser_client.cc",
- "blimp_content_browser_client.h",
- "blimp_network_delegate.cc",
- "blimp_network_delegate.h",
- "blimp_permission_manager.cc",
- "blimp_permission_manager.h",
- "blimp_url_request_context_getter.cc",
- "blimp_url_request_context_getter.h",
- "blimp_window.cc",
- "blimp_window.h",
- ]
-
- deps = [
- "//base",
- "//blimp/engine/ui",
- "//content",
- "//content/public/browser",
- "//content/public/common",
- "//content/public/utility",
- "//net",
- "//ui/base",
- "//ui/resources",
- ]
-}
diff --git a/blimp/engine/browser/blimp_browser_context.cc b/blimp/engine/browser/blimp_browser_context.cc
deleted file mode 100644
index 9b6c6b0..0000000
--- a/blimp/engine/browser/blimp_browser_context.cc
+++ /dev/null
@@ -1,170 +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.
-
-#include "blimp/engine/browser/blimp_browser_context.h"
-
-#include "base/bind.h"
-#include "base/environment.h"
-#include "base/files/file_util.h"
-#include "base/nix/xdg_util.h"
-#include "base/path_service.h"
-#include "blimp/engine/browser/blimp_permission_manager.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/storage_partition.h"
-#include "content/public/common/content_switches.h"
-
-namespace blimp {
-namespace engine {
-
-// Contains URLRequestContextGetter required for resource loading.
-class BlimpResourceContext : public content::ResourceContext {
- public:
- BlimpResourceContext() {}
- ~BlimpResourceContext() override {}
-
- void set_url_request_context_getter(
- const scoped_refptr<BlimpURLRequestContextGetter>& getter) {
- getter_ = getter;
- }
-
- const scoped_refptr<BlimpURLRequestContextGetter>&
- url_request_context_getter() {
- return getter_;
- }
-
- // content::ResourceContext implementation.
- net::HostResolver* GetHostResolver() override;
- net::URLRequestContext* GetRequestContext() override;
-
- private:
- scoped_refptr<BlimpURLRequestContextGetter> getter_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpResourceContext);
-};
-
-net::HostResolver* BlimpResourceContext::GetHostResolver() {
- return getter_->host_resolver();
-}
-
-net::URLRequestContext* BlimpResourceContext::GetRequestContext() {
- return getter_->GetURLRequestContext();
-}
-
-BlimpBrowserContext::BlimpBrowserContext(bool off_the_record,
- net::NetLog* net_log)
- : resource_context_(new BlimpResourceContext),
- ignore_certificate_errors_(false),
- off_the_record_(off_the_record),
- net_log_(net_log) {
- InitWhileIOAllowed();
-}
-
-BlimpBrowserContext::~BlimpBrowserContext() {
- if (resource_context_) {
- content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
- resource_context_.release());
- }
-}
-
-void BlimpBrowserContext::InitWhileIOAllowed() {
- // Ensures ~/.config/blimp_engine directory exists.
- scoped_ptr<base::Environment> env(base::Environment::Create());
- base::FilePath config_dir(base::nix::GetXDGDirectory(
- env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir));
- path_ = config_dir.Append("blimp_engine");
- if (!base::PathExists(path_))
- base::CreateDirectory(path_);
-}
-
-scoped_ptr<content::ZoomLevelDelegate>
-BlimpBrowserContext::CreateZoomLevelDelegate(const base::FilePath&) {
- return nullptr;
-}
-
-base::FilePath BlimpBrowserContext::GetPath() const {
- return path_;
-}
-
-bool BlimpBrowserContext::IsOffTheRecord() const {
- return off_the_record_;
-}
-
-content::DownloadManagerDelegate*
-BlimpBrowserContext::GetDownloadManagerDelegate() {
- return nullptr;
-}
-
-net::URLRequestContextGetter* BlimpBrowserContext::GetRequestContext() {
- return GetDefaultStoragePartition(this)->GetURLRequestContext();
-}
-
-const scoped_refptr<BlimpURLRequestContextGetter>&
-BlimpBrowserContext::CreateRequestContext(
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors) {
- DCHECK(!resource_context_->url_request_context_getter());
- // net_log_ is owned by BrowserMainParts.
- resource_context_->set_url_request_context_getter(
- new BlimpURLRequestContextGetter(
- ignore_certificate_errors_, GetPath(),
- content::BrowserThread::UnsafeGetMessageLoopForThread(
- content::BrowserThread::IO)
- ->task_runner(),
- content::BrowserThread::UnsafeGetMessageLoopForThread(
- content::BrowserThread::FILE)
- ->task_runner(),
- protocol_handlers, request_interceptors.Pass(), net_log_));
- return resource_context_->url_request_context_getter();
-}
-
-net::URLRequestContextGetter*
-BlimpBrowserContext::GetRequestContextForRenderProcess(int renderer_child_id) {
- return GetRequestContext();
-}
-
-net::URLRequestContextGetter* BlimpBrowserContext::GetMediaRequestContext() {
- return GetRequestContext();
-}
-
-net::URLRequestContextGetter*
-BlimpBrowserContext::GetMediaRequestContextForRenderProcess(
- int renderer_child_id) {
- return GetRequestContext();
-}
-
-net::URLRequestContextGetter*
-BlimpBrowserContext::GetMediaRequestContextForStoragePartition(
- const base::FilePath& partition_path,
- bool in_memory) {
- return GetRequestContext();
-}
-
-content::ResourceContext* BlimpBrowserContext::GetResourceContext() {
- return resource_context_.get();
-}
-
-content::BrowserPluginGuestManager* BlimpBrowserContext::GetGuestManager() {
- return nullptr;
-}
-
-storage::SpecialStoragePolicy* BlimpBrowserContext::GetSpecialStoragePolicy() {
- return nullptr;
-}
-
-content::PushMessagingService* BlimpBrowserContext::GetPushMessagingService() {
- return nullptr;
-}
-
-content::SSLHostStateDelegate* BlimpBrowserContext::GetSSLHostStateDelegate() {
- return nullptr;
-}
-
-content::PermissionManager* BlimpBrowserContext::GetPermissionManager() {
- if (!permission_manager_)
- permission_manager_.reset(new BlimpPermissionManager());
- return permission_manager_.get();
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_browser_context.h b/blimp/engine/browser/blimp_browser_context.h
deleted file mode 100644
index 0bb08cf..0000000
--- a/blimp/engine/browser/blimp_browser_context.h
+++ /dev/null
@@ -1,79 +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 BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_CONTEXT_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_CONTEXT_H_
-
-#include "base/files/file_path.h"
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "blimp/engine/browser/blimp_url_request_context_getter.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/content_browser_client.h"
-#include "content/public/browser/resource_context.h"
-#include "net/url_request/url_request_job_factory.h"
-
-namespace net {
-class NetLog;
-}
-
-namespace blimp {
-namespace engine {
-
-class BlimpResourceContext;
-class PermissionManager;
-
-class BlimpBrowserContext : public content::BrowserContext {
- public:
- // Caller owns |net_log| and ensures it out-lives this browser context.
- BlimpBrowserContext(bool off_the_record, net::NetLog* net_log);
- ~BlimpBrowserContext() override;
-
- // content::BrowserContext implementation.
- scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
- const base::FilePath& partition_path) override;
- base::FilePath GetPath() const override;
- bool IsOffTheRecord() const override;
- net::URLRequestContextGetter* GetRequestContext() override;
- net::URLRequestContextGetter* GetRequestContextForRenderProcess(
- int renderer_child_id) override;
- net::URLRequestContextGetter* GetMediaRequestContext() override;
- net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
- int renderer_child_id) override;
- net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition(
- const base::FilePath& partition_path,
- bool in_memory) override;
- content::ResourceContext* GetResourceContext() override;
- content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
- content::BrowserPluginGuestManager* GetGuestManager() override;
- storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
- content::PushMessagingService* GetPushMessagingService() override;
- content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
- content::PermissionManager* GetPermissionManager() override;
-
- // The content of |protocol_handlers| is swapped into the returned instance.
- // Caller should take a reference to the returned instance via scoped_refptr.
- const scoped_refptr<BlimpURLRequestContextGetter>& CreateRequestContext(
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors);
-
- private:
- // Performs initialization of the BlimpBrowserContext while IO is still
- // allowed on the current thread.
- void InitWhileIOAllowed();
-
- scoped_ptr<BlimpResourceContext> resource_context_;
- bool ignore_certificate_errors_;
- scoped_ptr<content::PermissionManager> permission_manager_;
- bool off_the_record_;
- net::NetLog* net_log_;
- base::FilePath path_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpBrowserContext);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_CONTEXT_H_
diff --git a/blimp/engine/browser/blimp_browser_main_parts.cc b/blimp/engine/browser/blimp_browser_main_parts.cc
deleted file mode 100644
index a1c0474..0000000
--- a/blimp/engine/browser/blimp_browser_main_parts.cc
+++ /dev/null
@@ -1,61 +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.
-
-#include "blimp/engine/browser/blimp_browser_main_parts.h"
-
-#include "base/command_line.h"
-#include "blimp/engine/browser/blimp_window.h"
-#include "blimp/engine/ui/blimp_screen.h"
-#include "content/public/browser/browser_thread.h"
-#include "net/base/net_module.h"
-#include "net/log/net_log.h"
-#include "url/gurl.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-
-const char kDefaultURL[] = "https://www.google.com/";
-
-GURL GetStartupURL() {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- const base::CommandLine::StringVector& args = command_line->GetArgs();
- if (args.empty())
- return GURL(kDefaultURL);
-
- GURL url(args[0]);
- if (url.is_valid() && url.has_scheme())
- return url;
-
- return GURL(kDefaultURL);
-}
-
-} // namespace
-
-BlimpBrowserMainParts::BlimpBrowserMainParts(
- const content::MainFunctionParams& parameters) {}
-
-BlimpBrowserMainParts::~BlimpBrowserMainParts() {}
-
-void BlimpBrowserMainParts::PreMainMessageLoopRun() {
- net_log_.reset(new net::NetLog());
- browser_context_.reset(new BlimpBrowserContext(false, net_log_.get()));
- BlimpWindow::Create(browser_context_.get(), GetStartupURL(), nullptr,
- gfx::Size());
-}
-
-int BlimpBrowserMainParts::PreCreateThreads() {
- screen_.reset(new BlimpScreen);
- DCHECK(!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE));
- gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
- return 0;
-}
-
-void BlimpBrowserMainParts::PostMainMessageLoopRun() {
- browser_context_.reset();
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_browser_main_parts.h b/blimp/engine/browser/blimp_browser_main_parts.h
deleted file mode 100644
index 5c2e991..0000000
--- a/blimp/engine/browser/blimp_browser_main_parts.h
+++ /dev/null
@@ -1,45 +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 BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_MAIN_PARTS_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_MAIN_PARTS_H_
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "blimp/engine/browser/blimp_browser_context.h"
-#include "content/public/browser/browser_main_parts.h"
-
-namespace net {
-class NetLog;
-}
-
-namespace blimp {
-namespace engine {
-
-class BlimpScreen;
-
-class BlimpBrowserMainParts : public content::BrowserMainParts {
- public:
- explicit BlimpBrowserMainParts(const content::MainFunctionParams& parameters);
- ~BlimpBrowserMainParts() override;
-
- // content::BrowserMainParts implementation.
- void PreMainMessageLoopRun() override;
- void PostMainMessageLoopRun() override;
- int PreCreateThreads() override;
-
- BlimpBrowserContext* browser_context() { return browser_context_.get(); }
-
- private:
- scoped_ptr<net::NetLog> net_log_;
- scoped_ptr<BlimpBrowserContext> browser_context_;
- scoped_ptr<BlimpScreen> screen_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpBrowserMainParts);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_BROWSER_MAIN_PARTS_H_
diff --git a/blimp/engine/browser/blimp_content_browser_client.cc b/blimp/engine/browser/blimp_content_browser_client.cc
deleted file mode 100644
index 1023fbb..0000000
--- a/blimp/engine/browser/blimp_content_browser_client.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 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.
-
-#include "blimp/engine/browser/blimp_content_browser_client.h"
-#include "blimp/engine/browser/blimp_browser_context.h"
-#include "blimp/engine/browser/blimp_browser_main_parts.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpContentBrowserClient::BlimpContentBrowserClient() {}
-
-BlimpContentBrowserClient::~BlimpContentBrowserClient() {}
-
-content::BrowserMainParts* BlimpContentBrowserClient::CreateBrowserMainParts(
- const content::MainFunctionParams& parameters) {
- blimp_browser_main_parts_ = new BlimpBrowserMainParts(parameters);
- // BrowserMainLoop takes ownership of the returned BrowserMainParts.
- return blimp_browser_main_parts_;
-}
-
-net::URLRequestContextGetter* BlimpContentBrowserClient::CreateRequestContext(
- content::BrowserContext* content_browser_context,
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors) {
- BlimpBrowserContext* blimp_context =
- static_cast<BlimpBrowserContext*>(content_browser_context);
- return blimp_context->CreateRequestContext(protocol_handlers,
- request_interceptors.Pass())
- .get();
-}
-
-BlimpBrowserContext* BlimpContentBrowserClient::browser_context() {
- return blimp_browser_main_parts_->browser_context();
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_content_browser_client.h b/blimp/engine/browser/blimp_content_browser_client.h
deleted file mode 100644
index aa566cd..0000000
--- a/blimp/engine/browser/blimp_content_browser_client.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 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 BLIMP_ENGINE_BROWSER_BLIMP_CONTENT_BROWSER_CLIENT_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_CONTENT_BROWSER_CLIENT_H_
-
-#include "base/macros.h"
-#include "content/public/browser/content_browser_client.h"
-
-namespace blimp {
-namespace engine {
-
-class BlimpBrowserMainParts;
-class BlimpBrowserContext;
-
-class BlimpContentBrowserClient : public content::ContentBrowserClient {
- public:
- BlimpContentBrowserClient();
- ~BlimpContentBrowserClient() override;
-
- // content::ContentBrowserClient implementation.
- content::BrowserMainParts* CreateBrowserMainParts(
- const content::MainFunctionParams& parameters) override;
- net::URLRequestContextGetter* CreateRequestContext(
- content::BrowserContext* browser_context,
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors) override;
-
- BlimpBrowserContext* browser_context();
-
- private:
- // Owned by BrowserMainLoop
- BlimpBrowserMainParts* blimp_browser_main_parts_ = nullptr;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpContentBrowserClient);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_CONTENT_BROWSER_CLIENT_H_
diff --git a/blimp/engine/browser/blimp_network_delegate.cc b/blimp/engine/browser/blimp_network_delegate.cc
deleted file mode 100644
index c22da11..0000000
--- a/blimp/engine/browser/blimp_network_delegate.cc
+++ /dev/null
@@ -1,51 +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.
-
-#include "blimp/engine/browser/blimp_network_delegate.h"
-
-#include "net/base/net_errors.h"
-#include "net/base/static_cookie_policy.h"
-#include "net/url_request/url_request.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-bool g_accept_all_cookies = true;
-
-net::StaticCookiePolicy::Type GetPolicyType() {
- return g_accept_all_cookies
- ? net::StaticCookiePolicy::ALLOW_ALL_COOKIES
- : net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
-}
-
-} // namespace
-
-BlimpNetworkDelegate::BlimpNetworkDelegate() {}
-
-BlimpNetworkDelegate::~BlimpNetworkDelegate() {}
-
-void BlimpNetworkDelegate::SetAcceptAllCookies(bool accept) {
- g_accept_all_cookies = accept;
-}
-
-bool BlimpNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
- const net::CookieList& cookie_list) {
- net::StaticCookiePolicy policy(GetPolicyType());
- int rv =
- policy.CanGetCookies(request.url(), request.first_party_for_cookies());
- return rv == net::OK;
-}
-
-bool BlimpNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
- const std::string& cookie_line,
- net::CookieOptions* options) {
- net::StaticCookiePolicy policy(GetPolicyType());
- int rv =
- policy.CanSetCookie(request.url(), request.first_party_for_cookies());
- return rv == net::OK;
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_network_delegate.h b/blimp/engine/browser/blimp_network_delegate.h
deleted file mode 100644
index e8b0e2c..0000000
--- a/blimp/engine/browser/blimp_network_delegate.h
+++ /dev/null
@@ -1,38 +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 BLIMP_ENGINE_BROWSER_BLIMP_NETWORK_DELEGATE_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_NETWORK_DELEGATE_H_
-
-#include <string>
-
-#include "base/macros.h"
-#include "net/base/network_delegate_impl.h"
-
-namespace blimp {
-namespace engine {
-
-class BlimpNetworkDelegate : public net::NetworkDelegateImpl {
- public:
- BlimpNetworkDelegate();
- ~BlimpNetworkDelegate() override;
-
- // Affects subsequent cookie retrieval and setting.
- static void SetAcceptAllCookies(bool accept);
-
- private:
- // net::NetworkDelegate implementation.
- bool OnCanGetCookies(const net::URLRequest& request,
- const net::CookieList& cookie_list) override;
- bool OnCanSetCookie(const net::URLRequest& request,
- const std::string& cookie_line,
- net::CookieOptions* options) override;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpNetworkDelegate);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_NETWORK_DELEGATE_H_
diff --git a/blimp/engine/browser/blimp_permission_manager.cc b/blimp/engine/browser/blimp_permission_manager.cc
deleted file mode 100644
index 6cace1b..0000000
--- a/blimp/engine/browser/blimp_permission_manager.cc
+++ /dev/null
@@ -1,58 +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.
-
-#include "blimp/engine/browser/blimp_permission_manager.h"
-
-#include "base/callback.h"
-#include "content/public/browser/permission_type.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpPermissionManager::BlimpPermissionManager()
- : content::PermissionManager() {}
-
-BlimpPermissionManager::~BlimpPermissionManager() {}
-
-int BlimpPermissionManager::RequestPermission(
- content::PermissionType permission,
- content::RenderFrameHost* render_frame_host,
- const GURL& origin,
- bool user_gesture,
- const base::Callback<void(content::PermissionStatus)>& callback) {
- callback.Run(content::PermissionStatus::PERMISSION_STATUS_DENIED);
- return kNoPendingOperation;
-}
-
-void BlimpPermissionManager::CancelPermissionRequest(int request_id) {}
-
-void BlimpPermissionManager::ResetPermission(content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) {}
-
-content::PermissionStatus BlimpPermissionManager::GetPermissionStatus(
- content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) {
- return content::PermissionStatus::PERMISSION_STATUS_DENIED;
-}
-
-void BlimpPermissionManager::RegisterPermissionUsage(
- content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) {}
-
-int BlimpPermissionManager::SubscribePermissionStatusChange(
- content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin,
- const base::Callback<void(content::PermissionStatus)>& callback) {
- return -1;
-}
-
-void BlimpPermissionManager::UnsubscribePermissionStatusChange(
- int subscription_id) {}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_permission_manager.h b/blimp/engine/browser/blimp_permission_manager.h
deleted file mode 100644
index b9f0eb8..0000000
--- a/blimp/engine/browser/blimp_permission_manager.h
+++ /dev/null
@@ -1,52 +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 BLIMP_ENGINE_BROWSER_BLIMP_PERMISSION_MANAGER_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_PERMISSION_MANAGER_H_
-
-#include "base/callback_forward.h"
-#include "base/macros.h"
-#include "content/public/browser/permission_manager.h"
-
-namespace blimp {
-namespace engine {
-
-class BlimpPermissionManager : public content::PermissionManager {
- public:
- BlimpPermissionManager();
- ~BlimpPermissionManager() override;
-
- // content::PermissionManager implementation:
- int RequestPermission(
- content::PermissionType permission,
- content::RenderFrameHost* render_frame_host,
- const GURL& requesting_origin,
- bool user_gesture,
- const base::Callback<void(content::PermissionStatus)>& callback) override;
- void CancelPermissionRequest(int request_id) override;
- void ResetPermission(content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) override;
- content::PermissionStatus GetPermissionStatus(
- content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) override;
- void RegisterPermissionUsage(content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin) override;
- int SubscribePermissionStatusChange(
- content::PermissionType permission,
- const GURL& requesting_origin,
- const GURL& embedding_origin,
- const base::Callback<void(content::PermissionStatus)>& callback) override;
- void UnsubscribePermissionStatusChange(int subscription_id) override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(BlimpPermissionManager);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_PERMISSION_MANAGER_H_
diff --git a/blimp/engine/browser/blimp_url_request_context_getter.cc b/blimp/engine/browser/blimp_url_request_context_getter.cc
deleted file mode 100644
index e49c5f2..0000000
--- a/blimp/engine/browser/blimp_url_request_context_getter.cc
+++ /dev/null
@@ -1,224 +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.
-
-#include "blimp/engine/browser/blimp_url_request_context_getter.h"
-
-#include <algorithm>
-
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-#include "base/threading/sequenced_worker_pool.h"
-#include "base/threading/worker_pool.h"
-#include "blimp/engine/browser/blimp_network_delegate.h"
-#include "blimp/engine/common/blimp_content_client.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/cookie_store_factory.h"
-#include "content/public/common/content_switches.h"
-#include "net/base/cache_type.h"
-#include "net/cert/cert_verifier.h"
-#include "net/cookies/cookie_monster.h"
-#include "net/dns/host_resolver.h"
-#include "net/dns/mapped_host_resolver.h"
-#include "net/http/http_auth_handler_factory.h"
-#include "net/http/http_cache.h"
-#include "net/http/http_network_session.h"
-#include "net/http/http_server_properties_impl.h"
-#include "net/http/transport_security_state.h"
-#include "net/proxy/proxy_config_service.h"
-#include "net/proxy/proxy_service.h"
-#include "net/ssl/channel_id_service.h"
-#include "net/ssl/default_channel_id_store.h"
-#include "net/ssl/ssl_config_service_defaults.h"
-#include "net/url_request/data_protocol_handler.h"
-#include "net/url_request/file_protocol_handler.h"
-#include "net/url_request/static_http_user_agent_settings.h"
-#include "net/url_request/url_request_context.h"
-#include "net/url_request/url_request_context_storage.h"
-#include "net/url_request/url_request_intercepting_job_factory.h"
-#include "net/url_request/url_request_job_factory_impl.h"
-#include "url/url_constants.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-
-void InstallProtocolHandlers(net::URLRequestJobFactoryImpl* job_factory,
- content::ProtocolHandlerMap* protocol_handlers) {
- for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin();
- it != protocol_handlers->end(); ++it) {
- bool set_protocol = job_factory->SetProtocolHandler(
- it->first, make_scoped_ptr(it->second.release()));
- DCHECK(set_protocol);
- }
- protocol_handlers->clear();
-}
-
-} // namespace
-
-BlimpURLRequestContextGetter::BlimpURLRequestContextGetter(
- bool ignore_certificate_errors,
- const base::FilePath& base_path,
- const scoped_refptr<base::SingleThreadTaskRunner>& io_loop_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& file_loop_task_runner,
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors,
- net::NetLog* net_log)
- : ignore_certificate_errors_(ignore_certificate_errors),
- base_path_(base_path),
- io_loop_task_runner_(io_loop_task_runner),
- file_loop_task_runner_(file_loop_task_runner),
- net_log_(net_log),
- request_interceptors_(request_interceptors.Pass()) {
- // Must first be created on the UI thread.
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- std::swap(protocol_handlers_, *protocol_handlers);
-
- // We must create the proxy config service on the UI loop on Linux because it
- // must synchronously run on the glib message loop. This will be passed to
- // the URLRequestContextStorage on the IO thread in GetURLRequestContext().
- proxy_config_service_ = GetProxyConfigService();
-}
-
-BlimpURLRequestContextGetter::~BlimpURLRequestContextGetter() {}
-
-scoped_ptr<net::NetworkDelegate>
-BlimpURLRequestContextGetter::CreateNetworkDelegate() {
- return make_scoped_ptr(new BlimpNetworkDelegate).Pass();
-}
-
-scoped_ptr<net::ProxyConfigService>
-BlimpURLRequestContextGetter::GetProxyConfigService() {
- return net::ProxyService::CreateSystemProxyConfigService(
- io_loop_task_runner_, file_loop_task_runner_);
-}
-
-scoped_ptr<net::ProxyService> BlimpURLRequestContextGetter::GetProxyService() {
- return net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service_.Pass(), 0, url_request_context_->net_log());
-}
-
-net::URLRequestContext* BlimpURLRequestContextGetter::GetURLRequestContext() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
- if (!url_request_context_) {
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
-
- url_request_context_.reset(new net::URLRequestContext());
- url_request_context_->set_net_log(net_log_);
- network_delegate_ = CreateNetworkDelegate();
- url_request_context_->set_network_delegate(network_delegate_.get());
- storage_.reset(
- new net::URLRequestContextStorage(url_request_context_.get()));
- storage_->set_cookie_store(
- content::CreateCookieStore(content::CookieStoreConfig()));
- storage_->set_channel_id_service(make_scoped_ptr(
- new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
- base::WorkerPool::GetTaskRunner(true))));
- storage_->set_http_user_agent_settings(
- make_scoped_ptr(new net::StaticHttpUserAgentSettings(
- "en-us,en", GetBlimpEngineUserAgent())));
-
- scoped_ptr<net::HostResolver> host_resolver(
- net::HostResolver::CreateDefaultResolver(
- url_request_context_->net_log()));
-
- storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
- storage_->set_transport_security_state(
- make_scoped_ptr(new net::TransportSecurityState));
- storage_->set_proxy_service(GetProxyService());
- storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
- storage_->set_http_auth_handler_factory(
- net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
- storage_->set_http_server_properties(
- make_scoped_ptr(new net::HttpServerPropertiesImpl()));
-
- base::FilePath cache_path = base_path_.Append(FILE_PATH_LITERAL("Cache"));
- net::HttpCache::DefaultBackend* main_backend =
- new net::HttpCache::DefaultBackend(
- net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path, 0,
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::CACHE));
-
- net::HttpNetworkSession::Params network_session_params;
- network_session_params.cert_verifier =
- url_request_context_->cert_verifier();
- network_session_params.transport_security_state =
- url_request_context_->transport_security_state();
- network_session_params.channel_id_service =
- url_request_context_->channel_id_service();
- network_session_params.proxy_service =
- url_request_context_->proxy_service();
- network_session_params.ssl_config_service =
- url_request_context_->ssl_config_service();
- network_session_params.http_auth_handler_factory =
- url_request_context_->http_auth_handler_factory();
- network_session_params.network_delegate = network_delegate_.get();
- network_session_params.http_server_properties =
- url_request_context_->http_server_properties();
- network_session_params.net_log = url_request_context_->net_log();
- network_session_params.ignore_certificate_errors =
- ignore_certificate_errors_;
- if (command_line.HasSwitch(switches::kHostResolverRules)) {
- scoped_ptr<net::MappedHostResolver> mapped_host_resolver(
- new net::MappedHostResolver(host_resolver.Pass()));
- mapped_host_resolver->SetRulesFromString(
- command_line.GetSwitchValueASCII(switches::kHostResolverRules));
- host_resolver = mapped_host_resolver.Pass();
- }
-
- // Give |storage_| ownership at the end in case it's |mapped_host_resolver|.
- storage_->set_host_resolver(host_resolver.Pass());
- network_session_params.host_resolver =
- url_request_context_->host_resolver();
-
- storage_->set_http_transaction_factory(
- make_scoped_ptr(
- new net::HttpCache(network_session_params, main_backend))
- .Pass());
-
- scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
- new net::URLRequestJobFactoryImpl());
- // Keep ProtocolHandlers added in sync with
- // BlimpContentBrowserClient::IsHandledURL().
- InstallProtocolHandlers(job_factory.get(), &protocol_handlers_);
- bool set_protocol = job_factory->SetProtocolHandler(
- url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler));
- DCHECK(set_protocol);
-
- // Set up interceptors in the reverse order so that the last inceptor is at
- // the end of the linked list of job factories.
- scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
- for (auto i = request_interceptors_.rbegin();
- i != request_interceptors_.rend(); ++i) {
- top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
- top_job_factory.Pass(), make_scoped_ptr(*i)));
- }
- request_interceptors_.weak_clear();
- // Save the head of the job factory list at storage_.
- storage_->set_job_factory(top_job_factory.Pass());
- }
-
- return url_request_context_.get();
-}
-
-scoped_refptr<base::SingleThreadTaskRunner>
-BlimpURLRequestContextGetter::GetNetworkTaskRunner() const {
- return content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::IO);
-}
-
-net::HostResolver* BlimpURLRequestContextGetter::host_resolver() {
- return url_request_context_->host_resolver();
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_url_request_context_getter.h b/blimp/engine/browser/blimp_url_request_context_getter.h
deleted file mode 100644
index d0ae01b..0000000
--- a/blimp/engine/browser/blimp_url_request_context_getter.h
+++ /dev/null
@@ -1,78 +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 BLIMP_ENGINE_BROWSER_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_
-
-#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/public/browser/content_browser_client.h"
-#include "net/url_request/url_request_context_getter.h"
-
-namespace base {
-class MessageLoop;
-class SingleThreadTaskRunner;
-}
-
-namespace net {
-class HostResolver;
-class NetworkDelegate;
-class NetLog;
-class ProxyConfigService;
-class ProxyService;
-class URLRequestContextStorage;
-}
-
-namespace blimp {
-namespace engine {
-
-class BlimpURLRequestContextGetter : public net::URLRequestContextGetter {
- public:
- // The content of |protocol_handlers| is is swapped into the new instance.
- BlimpURLRequestContextGetter(
- bool ignore_certificate_errors,
- const base::FilePath& base_path,
- const scoped_refptr<base::SingleThreadTaskRunner>& io_loop_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& file_loop_task_runner,
- content::ProtocolHandlerMap* protocol_handlers,
- content::URLRequestInterceptorScopedVector request_interceptors,
- net::NetLog* net_log);
-
- // net::URLRequestContextGetter implementation.
- net::URLRequestContext* GetURLRequestContext() override;
- scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
- const override;
-
- net::HostResolver* host_resolver();
-
- protected:
- ~BlimpURLRequestContextGetter() override;
-
- // Used by subclasses to create their own implementation of NetworkDelegate
- // and net::ProxyService.
- virtual scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate();
- virtual scoped_ptr<net::ProxyConfigService> GetProxyConfigService();
- virtual scoped_ptr<net::ProxyService> GetProxyService();
-
- private:
- bool ignore_certificate_errors_;
- base::FilePath base_path_;
- scoped_refptr<base::SingleThreadTaskRunner> io_loop_task_runner_;
- scoped_refptr<base::SingleThreadTaskRunner> file_loop_task_runner_;
- net::NetLog* net_log_;
-
- scoped_ptr<net::ProxyConfigService> proxy_config_service_;
- scoped_ptr<net::NetworkDelegate> network_delegate_;
- scoped_ptr<net::URLRequestContextStorage> storage_;
- scoped_ptr<net::URLRequestContext> url_request_context_;
- content::ProtocolHandlerMap protocol_handlers_;
- content::URLRequestInterceptorScopedVector request_interceptors_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpURLRequestContextGetter);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_
diff --git a/blimp/engine/browser/blimp_window.cc b/blimp/engine/browser/blimp_window.cc
deleted file mode 100644
index bc79448..0000000
--- a/blimp/engine/browser/blimp_window.cc
+++ /dev/null
@@ -1,140 +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.
-
-#include "blimp/engine/browser/blimp_window.h"
-
-#include "base/strings/string_util.h"
-#include "blimp/engine/browser/blimp_browser_main_parts.h"
-#include "blimp/engine/browser/blimp_content_browser_client.h"
-#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/web_contents.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-const int kDefaultWindowWidthDip = 1;
-const int kDefaultWindowHeightDip = 1;
-
-// TODO(haibinlu): cleanup BlimpWindows on shutdown. See crbug/540498.
-typedef std::vector<BlimpWindow*> BlimpWindows;
-base::LazyInstance<BlimpWindows>::Leaky g_instances = LAZY_INSTANCE_INITIALIZER;
-
-// Returns the default size if |size| has 0 for width and/or height;
-// otherwise, returns |size|.
-gfx::Size AdjustWindowSize(const gfx::Size& size) {
- return size.IsEmpty()
- ? gfx::Size(kDefaultWindowWidthDip, kDefaultWindowHeightDip)
- : size;
-}
-} // namespace
-
-BlimpWindow::~BlimpWindow() {
- BlimpWindows* instances = g_instances.Pointer();
- BlimpWindows::iterator it(
- std::find(instances->begin(), instances->end(), this));
- DCHECK(it != instances->end());
- instances->erase(it);
-}
-
-// static
-void BlimpWindow::Create(content::BrowserContext* browser_context,
- const GURL& url,
- content::SiteInstance* site_instance,
- const gfx::Size& initial_size) {
- content::WebContents::CreateParams create_params(browser_context,
- site_instance);
- scoped_ptr<content::WebContents> web_contents(
- content::WebContents::Create(create_params));
- BlimpWindow* win = DoCreate(web_contents.Pass(), initial_size);
- if (!url.is_empty())
- win->LoadURL(url);
-}
-
-void BlimpWindow::LoadURL(const GURL& url) {
- content::NavigationController::LoadURLParams params(url);
- params.transition_type = ui::PageTransitionFromInt(
- ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
- web_contents_->GetController().LoadURLWithParams(params);
- web_contents_->Focus();
-}
-
-void BlimpWindow::AddNewContents(content::WebContents* source,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_rect,
- bool user_gesture,
- bool* was_blocked) {
- DoCreate(scoped_ptr<content::WebContents>(new_contents), initial_rect.size());
-}
-
-content::WebContents* BlimpWindow::OpenURLFromTab(
- content::WebContents* source,
- const content::OpenURLParams& params) {
- // CURRENT_TAB is the only one we implement for now.
- if (params.disposition != CURRENT_TAB)
- return nullptr;
- // TOOD(haibinlu): add helper method to get LoadURLParams from OpenURLParams.
- content::NavigationController::LoadURLParams load_url_params(params.url);
- load_url_params.source_site_instance = params.source_site_instance;
- load_url_params.referrer = params.referrer;
- load_url_params.frame_tree_node_id = params.frame_tree_node_id;
- load_url_params.transition_type = params.transition;
- load_url_params.extra_headers = params.extra_headers;
- load_url_params.should_replace_current_entry =
- params.should_replace_current_entry;
-
- if (params.transferred_global_request_id != content::GlobalRequestID()) {
- load_url_params.is_renderer_initiated = params.is_renderer_initiated;
- load_url_params.transferred_global_request_id =
- params.transferred_global_request_id;
- } else if (params.is_renderer_initiated) {
- load_url_params.is_renderer_initiated = true;
- }
-
- source->GetController().LoadURLWithParams(load_url_params);
- return source;
-}
-
-void BlimpWindow::RequestToLockMouse(content::WebContents* web_contents,
- bool user_gesture,
- bool last_unlocked_by_target) {
- web_contents->GotResponseToLockMouseRequest(true);
-}
-
-void BlimpWindow::CloseContents(content::WebContents* source) {
- delete this;
-}
-
-void BlimpWindow::ActivateContents(content::WebContents* contents) {
- contents->GetRenderViewHost()->Focus();
-}
-
-void BlimpWindow::DeactivateContents(content::WebContents* contents) {
- contents->GetRenderViewHost()->Blur();
-}
-
-BlimpWindow::BlimpWindow(scoped_ptr<content::WebContents> web_contents)
- : web_contents_(web_contents.Pass()) {
- web_contents_->SetDelegate(this);
- g_instances.Get().push_back(this);
-}
-
-// static
-BlimpWindow* BlimpWindow::DoCreate(
- scoped_ptr<content::WebContents> web_contents,
- const gfx::Size& initial_size) {
- BlimpWindow* win = new BlimpWindow(web_contents.Pass());
- content::RenderWidgetHostView* host_view =
- win->web_contents_->GetRenderWidgetHostView();
- if (host_view)
- host_view->SetSize(AdjustWindowSize(initial_size));
- return win;
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/browser/blimp_window.h b/blimp/engine/browser/blimp_window.h
deleted file mode 100644
index fadf3b6..0000000
--- a/blimp/engine/browser/blimp_window.h
+++ /dev/null
@@ -1,79 +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 BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
-#define BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
-
-#include <vector>
-
-#include "base/lazy_instance.h"
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "ui/gfx/geometry/size.h"
-
-namespace content {
-class BrowserContext;
-class SiteInstance;
-class WebContents;
-}
-
-class GURL;
-
-namespace blimp {
-namespace engine {
-
-// Owns and controls a WebContents instance corresponding to a window on
-// Blimp client.
-class BlimpWindow : public content::WebContentsDelegate {
- public:
- // This also unregisters itself with a singleton registry.
- ~BlimpWindow() override;
-
- // Creates a new blimp window with |initial_size| and navigates to the |url|.
- // Caller retains ownership of |browser_context| and |site_instance| and
- // ensures |browser_context| and |site_instance| outlives BlimpWindow.
- static void Create(content::BrowserContext* browser_context,
- const GURL& url,
- content::SiteInstance* site_instance,
- const gfx::Size& initial_size);
-
- // Navigates to |url|.
- void LoadURL(const GURL& url);
-
- // content::WebContentsDelegate implementation.
- content::WebContents* OpenURLFromTab(
- content::WebContents* source,
- const content::OpenURLParams& params) override;
- void AddNewContents(content::WebContents* source,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_rect,
- bool user_gesture,
- bool* was_blocked) override;
- void RequestToLockMouse(content::WebContents* web_contents,
- bool user_gesture,
- bool last_unlocked_by_target) override;
- void CloseContents(content::WebContents* source) override;
- void ActivateContents(content::WebContents* contents) override;
- void DeactivateContents(content::WebContents* contents) override;
-
- private:
- // The newly created instance registers itself with a singleton registry.
- explicit BlimpWindow(scoped_ptr<content::WebContents> web_contents);
-
- // Helper to create a new BlimpWindow given |web_contents|.
- // The newly window is owned by a singleton registry.
- static BlimpWindow* DoCreate(scoped_ptr<content::WebContents> web_contents,
- const gfx::Size& initial_size);
-
- scoped_ptr<content::WebContents> web_contents_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpWindow);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_BROWSER_BLIMP_WINDOW_H_
diff --git a/blimp/engine/common/BUILD.gn b/blimp/engine/common/BUILD.gn
deleted file mode 100644
index 48632dc..0000000
--- a/blimp/engine/common/BUILD.gn
+++ /dev/null
@@ -1,16 +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.
-
-source_set("common") {
- sources = [
- "blimp_content_client.cc",
- "blimp_content_client.h",
- ]
-
- deps = [
- "//base",
- "//content/public/common",
- "//ui/base",
- ]
-}
diff --git a/blimp/engine/common/blimp_content_client.cc b/blimp/engine/common/blimp_content_client.cc
deleted file mode 100644
index 00c2c2d..0000000
--- a/blimp/engine/common/blimp_content_client.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 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.
-
-#include "blimp/engine/common/blimp_content_client.h"
-
-#include "content/public/common/user_agent.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-
-namespace blimp {
-namespace engine {
-
-// TODO(haibinlu) Generate proper version. See crbug/537367.
-const char kProduct[] = "Chrome/20.77.33.5";
-
-std::string GetBlimpEngineUserAgent() {
- return content::BuildUserAgentFromProduct(kProduct);
-}
-
-BlimpContentClient::~BlimpContentClient() {}
-
-std::string BlimpContentClient::GetUserAgent() const {
- return GetBlimpEngineUserAgent();
-}
-
-base::string16 BlimpContentClient::GetLocalizedString(int message_id) const {
- return l10n_util::GetStringUTF16(message_id);
-}
-
-base::StringPiece BlimpContentClient::GetDataResource(
- int resource_id,
- ui::ScaleFactor scale_factor) const {
- return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
- resource_id, scale_factor);
-}
-
-base::RefCountedStaticMemory* BlimpContentClient::GetDataResourceBytes(
- int resource_id) const {
- return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- resource_id);
-}
-
-gfx::Image& BlimpContentClient::GetNativeImageNamed(int resource_id) const {
- return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
- resource_id);
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/common/blimp_content_client.h b/blimp/engine/common/blimp_content_client.h
deleted file mode 100644
index 8826a62..0000000
--- a/blimp/engine/common/blimp_content_client.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 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 BLIMP_ENGINE_COMMON_BLIMP_CONTENT_CLIENT_H_
-#define BLIMP_ENGINE_COMMON_BLIMP_CONTENT_CLIENT_H_
-
-#include <string>
-
-#include "content/public/common/content_client.h"
-
-namespace blimp {
-namespace engine {
-
-std::string GetBlimpEngineUserAgent();
-
-class BlimpContentClient : public content::ContentClient {
- public:
- ~BlimpContentClient() override;
-
- // content::ContentClient implementation.
- std::string GetUserAgent() const override;
- base::string16 GetLocalizedString(int message_id) const override;
- base::StringPiece GetDataResource(
- int resource_id,
- ui::ScaleFactor scale_factor) const override;
- base::RefCountedStaticMemory* GetDataResourceBytes(
- int resource_id) const override;
- gfx::Image& GetNativeImageNamed(int resource_id) const override;
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_COMMON_BLIMP_CONTENT_CLIENT_H_
diff --git a/blimp/engine/renderer/BUILD.gn b/blimp/engine/renderer/BUILD.gn
deleted file mode 100644
index 8d9db08..0000000
--- a/blimp/engine/renderer/BUILD.gn
+++ /dev/null
@@ -1,15 +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.
-
-source_set("renderer") {
- sources = [
- "blimp_content_renderer_client.cc",
- "blimp_content_renderer_client.h",
- ]
-
- deps = [
- "//components/web_cache/renderer",
- "//content/public/renderer",
- ]
-}
diff --git a/blimp/engine/renderer/blimp_content_renderer_client.cc b/blimp/engine/renderer/blimp_content_renderer_client.cc
deleted file mode 100644
index 6b6e7b7..0000000
--- a/blimp/engine/renderer/blimp_content_renderer_client.cc
+++ /dev/null
@@ -1,23 +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.
-
-#include "blimp/engine/renderer/blimp_content_renderer_client.h"
-
-#include "components/web_cache/renderer/web_cache_render_process_observer.h"
-#include "content/public/renderer/render_thread.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpContentRendererClient::BlimpContentRendererClient() {}
-
-BlimpContentRendererClient::~BlimpContentRendererClient() {}
-
-void BlimpContentRendererClient::RenderThreadStarted() {
- web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver());
- content::RenderThread::Get()->AddObserver(web_cache_observer_.get());
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/renderer/blimp_content_renderer_client.h b/blimp/engine/renderer/blimp_content_renderer_client.h
deleted file mode 100644
index 0006200..0000000
--- a/blimp/engine/renderer/blimp_content_renderer_client.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 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 BLIMP_ENGINE_RENDERER_BLIMP_CONTENT_RENDERER_CLIENT_H_
-#define BLIMP_ENGINE_RENDERER_BLIMP_CONTENT_RENDERER_CLIENT_H_
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/public/renderer/content_renderer_client.h"
-
-namespace web_cache {
-class WebCacheRenderProcessObserver;
-}
-
-namespace blimp {
-namespace engine {
-
-class BlimpContentRendererClient : public content::ContentRendererClient {
- public:
- BlimpContentRendererClient();
- ~BlimpContentRendererClient() override;
-
- // content::ContentRendererClient implementation.
- void RenderThreadStarted() override;
-
- private:
- // This observer manages the process-global web cache.
- scoped_ptr<web_cache::WebCacheRenderProcessObserver> web_cache_observer_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpContentRendererClient);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_RENDERER_BLIMP_CONTENT_RENDERER_CLIENT_H_
diff --git a/blimp/engine/ui/BUILD.gn b/blimp/engine/ui/BUILD.gn
deleted file mode 100644
index 4e88178..0000000
--- a/blimp/engine/ui/BUILD.gn
+++ /dev/null
@@ -1,14 +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.
-
-source_set("ui") {
- sources = [
- "blimp_screen.cc",
- "blimp_screen.h",
- ]
-
- deps = [
- "//ui/gfx",
- ]
-}
diff --git a/blimp/engine/ui/blimp_screen.cc b/blimp/engine/ui/blimp_screen.cc
deleted file mode 100644
index 2eba20f..0000000
--- a/blimp/engine/ui/blimp_screen.cc
+++ /dev/null
@@ -1,77 +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.
-
-#include "blimp/engine/ui/blimp_screen.h"
-
-namespace blimp {
-namespace engine {
-
-namespace {
-
-const int64 kDisplayId = 1;
-const int kDefaultDisplayWidth = 1;
-const int kDefaultDisplayHeight = 1;
-const float kDefaultScale = 1.0f;
-const int kNumDisplays = 1;
-
-} // namespace
-
-BlimpScreen::BlimpScreen() : display_(kDisplayId) {
- display_.SetScaleAndBounds(
- kDefaultScale, gfx::Rect(kDefaultDisplayWidth, kDefaultDisplayHeight));
-}
-
-BlimpScreen::~BlimpScreen() {}
-
-void BlimpScreen::UpdateDisplaySize(const gfx::Size& size) {
- display_.SetScaleAndBounds(kDefaultScale, gfx::Rect(size));
-}
-
-gfx::Point BlimpScreen::GetCursorScreenPoint() {
- return gfx::Point();
-}
-
-gfx::NativeWindow BlimpScreen::GetWindowUnderCursor() {
- NOTIMPLEMENTED();
- return gfx::NativeWindow(nullptr);
-}
-
-gfx::NativeWindow BlimpScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
- NOTIMPLEMENTED();
- return gfx::NativeWindow(nullptr);
-}
-
-int BlimpScreen::GetNumDisplays() const {
- return kNumDisplays;
-}
-
-std::vector<gfx::Display> BlimpScreen::GetAllDisplays() const {
- return std::vector<gfx::Display>(1, display_);
-}
-
-gfx::Display BlimpScreen::GetDisplayNearestWindow(
- gfx::NativeWindow window) const {
- return display_;
-}
-
-gfx::Display BlimpScreen::GetDisplayNearestPoint(
- const gfx::Point& point) const {
- return display_;
-}
-
-gfx::Display BlimpScreen::GetDisplayMatching(
- const gfx::Rect& match_rect) const {
- return display_;
-}
-
-gfx::Display BlimpScreen::GetPrimaryDisplay() const {
- return display_;
-}
-
-void BlimpScreen::AddObserver(gfx::DisplayObserver* observer) {}
-
-void BlimpScreen::RemoveObserver(gfx::DisplayObserver* observer) {}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/ui/blimp_screen.h b/blimp/engine/ui/blimp_screen.h
deleted file mode 100644
index 99858b8..0000000
--- a/blimp/engine/ui/blimp_screen.h
+++ /dev/null
@@ -1,47 +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 BLIMP_ENGINE_UI_BLIMP_SCREEN_H_
-#define BLIMP_ENGINE_UI_BLIMP_SCREEN_H_
-
-#include <vector>
-
-#include "ui/gfx/display.h"
-#include "ui/gfx/screen.h"
-
-namespace blimp {
-namespace engine {
-
-// Presents the client's single screen.
-class BlimpScreen : public gfx::Screen {
- public:
- BlimpScreen();
- ~BlimpScreen() override;
-
- // Updates the size reported by the primary display.
- void UpdateDisplaySize(const gfx::Size& size);
-
- // gfx::Screen implementation.
- gfx::Point GetCursorScreenPoint() override;
- gfx::NativeWindow GetWindowUnderCursor() override;
- gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override;
- int GetNumDisplays() const override;
- std::vector<gfx::Display> GetAllDisplays() const override;
- gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override;
- gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override;
- gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override;
- gfx::Display GetPrimaryDisplay() const override;
- void AddObserver(gfx::DisplayObserver* observer) override;
- void RemoveObserver(gfx::DisplayObserver* observer) override;
-
- private:
- gfx::Display display_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpScreen);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_UI_BLIMP_SCREEN_H_