summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 21:24:03 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 21:24:03 +0000
commit7eefc1d524a02b303cc33e87cb9c544252ddbaa9 (patch)
treeb80d597534193c71670bedde7977b500145ffc4a /ui
parenta85e7ce06cebd2cc0c9422113d9fdc24109b33f9 (diff)
downloadchromium_src-7eefc1d524a02b303cc33e87cb9c544252ddbaa9.zip
chromium_src-7eefc1d524a02b303cc33e87cb9c544252ddbaa9.tar.gz
chromium_src-7eefc1d524a02b303cc33e87cb9c544252ddbaa9.tar.bz2
Revert 131837 - Beginnings of a WebView.
http://crbug.com/105557 TEST=none Review URL: https://chromiumcodereview.appspot.com/10024081 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10054030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/controls/webview/DEPS4
-rw-r--r--ui/views/controls/webview/webview.cc47
-rw-r--r--ui/views/controls/webview/webview.h42
-rw-r--r--ui/views/examples/content_client/examples_browser_main_parts.cc123
-rw-r--r--ui/views/examples/content_client/examples_browser_main_parts.h75
-rw-r--r--ui/views/examples/content_client/examples_content_browser_client.cc373
-rw-r--r--ui/views/examples/content_client/examples_content_browser_client.h210
-rw-r--r--ui/views/examples/content_client/examples_main_delegate.cc108
-rw-r--r--ui/views/examples/content_client/examples_main_delegate.h64
-rw-r--r--ui/views/examples/examples_main.cc110
-rw-r--r--ui/views/examples/examples_window.cc16
-rw-r--r--ui/views/examples/examples_window.h7
-rw-r--r--ui/views/examples/webview_example.cc41
-rw-r--r--ui/views/examples/webview_example.h40
-rw-r--r--ui/views/views.gyp21
15 files changed, 102 insertions, 1179 deletions
diff --git a/ui/views/controls/webview/DEPS b/ui/views/controls/webview/DEPS
deleted file mode 100644
index aa3096a..0000000
--- a/ui/views/controls/webview/DEPS
+++ /dev/null
@@ -1,4 +0,0 @@
-include_rules = [
- "+ui/views",
- "+content",
-]
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
deleted file mode 100644
index 864ec1dd..0000000
--- a/ui/views/controls/webview/webview.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/controls/webview/webview.h"
-
-#include "content/public/browser/browser_context.h"
-#include "ipc/ipc_message.h"
-#include "ui/views/controls/native/native_view_host.h"
-
-namespace views {
-
-////////////////////////////////////////////////////////////////////////////////
-// WebView, public:
-
-WebView::WebView(content::BrowserContext* browser_context)
- : wcv_holder_(new NativeViewHost),
- browser_context_(browser_context) {
- Init();
-}
-
-WebView::~WebView() {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WebView, private:
-
-void WebView::Init() {
- AddChildView(wcv_holder_);
- web_contents_.reset(
- content::WebContents::Create(browser_context_, NULL, MSG_ROUTING_NONE,
- NULL, NULL));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WebView, View overrides:
-
-void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
- wcv_holder_->SetSize(bounds().size());
-}
-
-void WebView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
- if (is_add && child == this)
- wcv_holder_->Attach(web_contents_->GetNativeView());
-}
-
-} // namespace views
diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h
deleted file mode 100644
index c817d97..0000000
--- a/ui/views/controls/webview/webview.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_
-#define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_
-#pragma once
-
-#include "base/memory/scoped_ptr.h"
-#include "content/public/browser/web_contents.h"
-#include "ui/views/view.h"
-
-namespace views {
-
-class NativeViewHost;
-
-class VIEWS_EXPORT WebView : public View {
- public:
- explicit WebView(content::BrowserContext* browser_context);
- virtual ~WebView();
-
- content::WebContents* web_contents() { return web_contents_.get(); }
-
- private:
- void Init();
-
- // Overridden from View:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
- virtual void ViewHierarchyChanged(bool is_add,
- View* parent,
- View* child) OVERRIDE;
-
- NativeViewHost* wcv_holder_;
- scoped_ptr<content::WebContents> web_contents_;
- content::BrowserContext* browser_context_;
-
- DISALLOW_COPY_AND_ASSIGN(WebView);
-};
-
-} // namespace views
-
-#endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ \ No newline at end of file
diff --git a/ui/views/examples/content_client/examples_browser_main_parts.cc b/ui/views/examples/content_client/examples_browser_main_parts.cc
deleted file mode 100644
index 62d3686..0000000
--- a/ui/views/examples/content_client/examples_browser_main_parts.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/examples/content_client/examples_browser_main_parts.h"
-
-#include "base/bind.h"
-#include "base/command_line.h"
-#include "base/message_loop.h"
-#include "base/string_number_conversions.h"
-#include "base/threading/thread.h"
-#include "base/threading/thread_restrictions.h"
-#include "content/public/common/content_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_devtools_delegate.h"
-#include "content/shell/shell_switches.h"
-#include "googleurl/src/gurl.h"
-#include "net/base/net_module.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/views/examples/examples_window.h"
-#include "ui/views/test/test_views_delegate.h"
-#include "ui/views/focus/accelerator_handler.h"
-
-#if defined(USE_AURA)
-#include "ui/aura/client/stacking_client.h"
-#include "ui/aura/env.h"
-#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
-#include "ui/gfx/compositor/compositor.h"
-#include "ui/gfx/compositor/test/compositor_test_support.h"
-#include "ui/views/widget/native_widget_aura.h"
-#endif
-
-namespace views {
-namespace examples {
-namespace {
-#if defined(USE_AURA)
-class RootWindowStackingClient : public aura::client::StackingClient {
- public:
- explicit RootWindowStackingClient() {
- aura::client::SetStackingClient(this);
- }
-
- virtual ~RootWindowStackingClient() {
- aura::client::SetStackingClient(NULL);
- }
-
- // Overridden from aura::client::StackingClient:
- virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE {
- return window->GetRootWindow();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RootWindowStackingClient);
-};
-#endif
-}
-
-ExamplesBrowserMainParts::ExamplesBrowserMainParts(
- const content::MainFunctionParams& parameters)
- : BrowserMainParts(),
- devtools_delegate_(NULL) {
-}
-
-ExamplesBrowserMainParts::~ExamplesBrowserMainParts() {
-}
-
-#if !defined(OS_MACOSX)
-void ExamplesBrowserMainParts::PreMainMessageLoopStart() {
-}
-#endif
-
-int ExamplesBrowserMainParts::PreCreateThreads() {
- return 0;
-}
-
-void ExamplesBrowserMainParts::PreMainMessageLoopRun() {
- browser_context_.reset(new content::ShellBrowserContext);
-
-#if defined(USE_AURA)
- // TURN ON THE HAX.
- views::NativeWidgetAura::set_aura_desktop_hax();
- ui::CompositorTestSupport::Initialize();
- root_window_stacking_client_.reset(new RootWindowStackingClient);
-#endif
- views_delegate_.reset(new views::TestViewsDelegate);
-
- views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE,
- browser_context_.get());
-}
-
-void ExamplesBrowserMainParts::PostMainMessageLoopRun() {
- if (devtools_delegate_)
- devtools_delegate_->Stop();
- browser_context_.reset();
- views_delegate_.reset();
-#if defined(USE_AURA)
- root_window_stacking_client_.reset();
- aura::Env::DeleteInstance();
- ui::CompositorTestSupport::Terminate();
-#endif
-}
-
-bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) {
- // xxx: Hax here because this kills event handling.
-#if !defined(USE_AURA)
- views::AcceleratorHandler accelerator_handler;
- MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler);
-#else
- MessageLoopForUI::current()->Run();
-#endif
- return true;
-}
-
-ui::Clipboard* ExamplesBrowserMainParts::GetClipboard() {
- if (!clipboard_.get())
- clipboard_.reset(new ui::Clipboard());
- return clipboard_.get();
-}
-
-} // namespace examples
-} // namespace views
diff --git a/ui/views/examples/content_client/examples_browser_main_parts.h b/ui/views/examples/content_client/examples_browser_main_parts.h
deleted file mode 100644
index bdbcbc9..0000000
--- a/ui/views/examples/content_client/examples_browser_main_parts.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
-#define UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/public/browser/browser_main_parts.h"
-
-namespace base {
-class Thread;
-}
-
-namespace ui {
-class Clipboard;
-}
-
-namespace content {
-
-class ShellBrowserContext;
-class ShellDevToolsDelegate;
-struct MainFunctionParams;
-}
-
-namespace views {
-class ViewsDelegate;
-namespace examples {
-
-class ExamplesBrowserMainParts : public content::BrowserMainParts {
- public:
- explicit ExamplesBrowserMainParts(
- const content::MainFunctionParams& parameters);
- virtual ~ExamplesBrowserMainParts();
-
- // Overridden from content::BrowserMainParts:
- virtual void PreEarlyInitialization() OVERRIDE {}
- virtual void PostEarlyInitialization() OVERRIDE {}
- virtual void PreMainMessageLoopStart() OVERRIDE;
- virtual void PostMainMessageLoopStart() OVERRIDE {}
- virtual void ToolkitInitialized() OVERRIDE {}
- virtual int PreCreateThreads() OVERRIDE;
- virtual void PreMainMessageLoopRun() OVERRIDE;
- virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
- virtual void PostMainMessageLoopRun() OVERRIDE;
- virtual void PostDestroyThreads() OVERRIDE {}
-
- ui::Clipboard* GetClipboard();
- content::ShellDevToolsDelegate* devtools_delegate() {
- return devtools_delegate_;
- }
-
- content::ShellBrowserContext* browser_context() {
- return browser_context_.get();
- }
-
- private:
- scoped_ptr<content::ShellBrowserContext> browser_context_;
-
- scoped_ptr<ui::Clipboard> clipboard_;
- content::ShellDevToolsDelegate* devtools_delegate_;
- scoped_ptr<views::ViewsDelegate> views_delegate_;
-#if defined(USE_AURA)
- scoped_ptr<aura::client::StackingClient> root_window_stacking_client_;
-#endif
-
- DISALLOW_COPY_AND_ASSIGN(ExamplesBrowserMainParts);
-};
-
-} // namespace examples
-} // namespace views
-
-#endif // UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
diff --git a/ui/views/examples/content_client/examples_content_browser_client.cc b/ui/views/examples/content_client/examples_content_browser_client.cc
deleted file mode 100644
index 3dabb91..0000000
--- a/ui/views/examples/content_client/examples_content_browser_client.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/examples/content_client/examples_content_browser_client.h"
-
-#include "base/command_line.h"
-#include "base/file_path.h"
-#include "content/public/browser/resource_dispatcher_host.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_devtools_delegate.h"
-#include "content/shell/shell_render_view_host_observer.h"
-#include "content/shell/shell_resource_dispatcher_host_delegate.h"
-#include "content/shell/shell_switches.h"
-#include "googleurl/src/gurl.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/views/examples/content_client/examples_browser_main_parts.h"
-
-namespace views {
-namespace examples {
-
-ExamplesContentBrowserClient::ExamplesContentBrowserClient()
- : examples_browser_main_parts_(NULL) {
-}
-
-ExamplesContentBrowserClient::~ExamplesContentBrowserClient() {
-}
-
-content::BrowserMainParts* ExamplesContentBrowserClient::CreateBrowserMainParts(
- const content::MainFunctionParams& parameters) {
- examples_browser_main_parts_ = new ExamplesBrowserMainParts(parameters);
- return examples_browser_main_parts_;
-}
-
-content::WebContentsView*
- ExamplesContentBrowserClient::OverrideCreateWebContentsView(
- content::WebContents* web_contents) {
- return NULL;
-}
-
-content::WebContentsViewDelegate*
- ExamplesContentBrowserClient::GetWebContentsViewDelegate(
- content::WebContents* web_contents) {
- return NULL;
-}
-
-void ExamplesContentBrowserClient::RenderViewHostCreated(
- content::RenderViewHost* render_view_host) {
- new content::ShellRenderViewHostObserver(render_view_host);
-}
-
-void ExamplesContentBrowserClient::RenderProcessHostCreated(
- content::RenderProcessHost* host) {
-}
-
-content::WebUIControllerFactory*
- ExamplesContentBrowserClient::GetWebUIControllerFactory() {
- return NULL;
-}
-
-GURL ExamplesContentBrowserClient::GetEffectiveURL(
- content::BrowserContext* browser_context, const GURL& url) {
- return GURL();
-}
-
-bool ExamplesContentBrowserClient::ShouldUseProcessPerSite(
- content::BrowserContext* browser_context, const GURL& effective_url) {
- return false;
-}
-
-bool ExamplesContentBrowserClient::IsHandledURL(const GURL& url) {
- return false;
-}
-
-bool ExamplesContentBrowserClient::IsSuitableHost(
- content::RenderProcessHost* process_host,
- const GURL& site_url) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::ShouldTryToUseExistingProcessHost(
- content::BrowserContext* browser_context, const GURL& url) {
- return false;
-}
-
-void ExamplesContentBrowserClient::SiteInstanceGotProcess(
- content::SiteInstance* site_instance) {
-}
-
-void ExamplesContentBrowserClient::SiteInstanceDeleting(
- content::SiteInstance* site_instance) {
-}
-
-bool ExamplesContentBrowserClient::ShouldSwapProcessesForNavigation(
- const GURL& current_url,
- const GURL& new_url) {
- return false;
-}
-
-std::string ExamplesContentBrowserClient::GetCanonicalEncodingNameByAliasName(
- const std::string& alias_name) {
- return std::string();
-}
-
-void ExamplesContentBrowserClient::AppendExtraCommandLineSwitches(
- CommandLine* command_line, int child_process_id) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
- command_line->AppendSwitch(switches::kDumpRenderTree);
-}
-
-std::string ExamplesContentBrowserClient::GetApplicationLocale() {
- return std::string();
-}
-
-std::string ExamplesContentBrowserClient::GetAcceptLangs(
- content::BrowserContext* context) {
- return std::string();
-}
-
-SkBitmap* ExamplesContentBrowserClient::GetDefaultFavicon() {
- static SkBitmap empty;
- return &empty;
-}
-
-bool ExamplesContentBrowserClient::AllowAppCache(
- const GURL& manifest_url,
- const GURL& first_party,
- content::ResourceContext* context) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowGetCookie(
- const GURL& url,
- const GURL& first_party,
- const net::CookieList& cookie_list,
- content::ResourceContext* context,
- int render_process_id,
- int render_view_id) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowSetCookie(
- const GURL& url,
- const GURL& first_party,
- const std::string& cookie_line,
- content::ResourceContext* context,
- int render_process_id,
- int render_view_id,
- net::CookieOptions* options) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowSaveLocalState(
- content::ResourceContext* context) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowWorkerDatabase(
- const GURL& url,
- const string16& name,
- const string16& display_name,
- unsigned long estimated_size,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowWorkerFileSystem(
- const GURL& url,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) {
- return true;
-}
-
-bool ExamplesContentBrowserClient::AllowWorkerIndexedDB(
- const GURL& url,
- const string16& name,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) {
- return true;
-}
-
-content::QuotaPermissionContext*
- ExamplesContentBrowserClient::CreateQuotaPermissionContext() {
- return NULL;
-}
-
-net::URLRequestContext*
- ExamplesContentBrowserClient::OverrideRequestContextForURL(
- const GURL& url, content::ResourceContext* context) {
- return NULL;
-}
-
-void ExamplesContentBrowserClient::OpenItem(const FilePath& path) {
-}
-
-void ExamplesContentBrowserClient::ShowItemInFolder(const FilePath& path) {
-}
-
-void ExamplesContentBrowserClient::AllowCertificateError(
- int render_process_id,
- int render_view_id,
- int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL& request_url,
- bool overridable,
- const base::Callback<void(bool)>& callback,
- bool* cancel_request) {
-}
-
-void ExamplesContentBrowserClient::SelectClientCertificate(
- int render_process_id,
- int render_view_id,
- const net::HttpNetworkSession* network_session,
- net::SSLCertRequestInfo* cert_request_info,
- const base::Callback<void(net::X509Certificate*)>& callback) {
-}
-
-void ExamplesContentBrowserClient::AddNewCertificate(
- net::URLRequest* request,
- net::X509Certificate* cert,
- int render_process_id,
- int render_view_id) {
-}
-
-void ExamplesContentBrowserClient::RequestMediaAccessPermission(
- const content::MediaStreamRequest* request,
- const content::MediaResponseCallback& callback) {
-}
-
-content::MediaObserver* ExamplesContentBrowserClient::GetMediaObserver() {
- return NULL;
-}
-
-void ExamplesContentBrowserClient::RequestDesktopNotificationPermission(
- const GURL& source_origin,
- int callback_context,
- int render_process_id,
- int render_view_id) {
-}
-
-WebKit::WebNotificationPresenter::Permission
- ExamplesContentBrowserClient::CheckDesktopNotificationPermission(
- const GURL& source_origin,
- content::ResourceContext* context,
- int render_process_id) {
- return WebKit::WebNotificationPresenter::PermissionAllowed;
-}
-
-void ExamplesContentBrowserClient::ShowDesktopNotification(
- const content::ShowDesktopNotificationHostMsgParams& params,
- int render_process_id,
- int render_view_id,
- bool worker) {
-}
-
-void ExamplesContentBrowserClient::CancelDesktopNotification(
- int render_process_id,
- int render_view_id,
- int notification_id) {
-}
-
-bool ExamplesContentBrowserClient::CanCreateWindow(
- const GURL& opener_url,
- const GURL& origin,
- WindowContainerType container_type,
- content::ResourceContext* context,
- int render_process_id,
- bool* no_javascript_access) {
- *no_javascript_access = false;
- return true;
-}
-
-std::string ExamplesContentBrowserClient::GetWorkerProcessTitle(
- const GURL& url, content::ResourceContext* context) {
- return std::string();
-}
-
-void ExamplesContentBrowserClient::ResourceDispatcherHostCreated() {
- resource_dispatcher_host_delegate_.reset(
- new content::ShellResourceDispatcherHostDelegate);
- content::ResourceDispatcherHost::Get()->SetDelegate(
- resource_dispatcher_host_delegate_.get());
-}
-
-content::SpeechRecognitionManagerDelegate*
- ExamplesContentBrowserClient::GetSpeechRecognitionManagerDelegate() {
- return NULL;
-}
-
-ui::Clipboard* ExamplesContentBrowserClient::GetClipboard() {
- return examples_browser_main_parts_->GetClipboard();
-}
-
-net::NetLog* ExamplesContentBrowserClient::GetNetLog() {
- return NULL;
-}
-
-content::AccessTokenStore*
- ExamplesContentBrowserClient::CreateAccessTokenStore() {
- return NULL;
-}
-
-bool ExamplesContentBrowserClient::IsFastShutdownPossible() {
- return true;
-}
-
-void ExamplesContentBrowserClient::OverrideWebkitPrefs(
- content::RenderViewHost* rvh,
- const GURL& url,
- WebPreferences* prefs) {
-}
-
-void ExamplesContentBrowserClient::UpdateInspectorSetting(
- content::RenderViewHost* rvh,
- const std::string& key,
- const std::string& value) {
-}
-
-void ExamplesContentBrowserClient::ClearInspectorSettings(
- content::RenderViewHost* rvh) {
-}
-
-void ExamplesContentBrowserClient::BrowserURLHandlerCreated(
- content::BrowserURLHandler* handler) {
-}
-
-void ExamplesContentBrowserClient::ClearCache(content::RenderViewHost* rvh) {
-}
-
-void ExamplesContentBrowserClient::ClearCookies(content::RenderViewHost* rvh) {
-}
-
-FilePath ExamplesContentBrowserClient::GetDefaultDownloadDirectory() {
- return FilePath();
-}
-
-std::string ExamplesContentBrowserClient::GetDefaultDownloadName() {
- return "download";
-}
-
-bool ExamplesContentBrowserClient::AllowSocketAPI(
- content::BrowserContext* browser_context,
- const GURL& url) {
- return false;
-}
-
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-int ExamplesContentBrowserClient::GetCrashSignalFD(
- const CommandLine& command_line) {
- return -1;
-}
-#endif
-
-#if defined(OS_WIN)
-const wchar_t* ExamplesContentBrowserClient::GetResourceDllName() {
- return NULL;
-}
-#endif
-
-#if defined(USE_NSS)
-crypto::CryptoModuleBlockingPasswordDelegate*
- ExamplesContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) {
- return NULL;
-}
-#endif
-
-content::ShellBrowserContext* ExamplesContentBrowserClient::browser_context() {
- return examples_browser_main_parts_->browser_context();
-}
-
-} // namespace examples
-} // namespace views
diff --git a/ui/views/examples/content_client/examples_content_browser_client.h b/ui/views/examples/content_client/examples_content_browser_client.h
deleted file mode 100644
index 6addff2..0000000
--- a/ui/views/examples/content_client/examples_content_browser_client.h
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
-#define UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
-#pragma once
-
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/public/browser/content_browser_client.h"
-
-namespace content {
-class ShellBrowserContext;
-class ShellBrowserMainParts;
-class ShellResourceDispatcherHostDelegate;
-}
-
-namespace views {
-namespace examples {
-
-class ExamplesBrowserMainParts;
-
-class ExamplesContentBrowserClient : public content::ContentBrowserClient {
- public:
- ExamplesContentBrowserClient();
- virtual ~ExamplesContentBrowserClient();
-
- // Overridden from content::ContentBrowserClient:
- virtual content::BrowserMainParts* CreateBrowserMainParts(
- const content::MainFunctionParams& parameters) OVERRIDE;
- virtual content::WebContentsView* OverrideCreateWebContentsView(
- content::WebContents* web_contents) OVERRIDE;
- virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate(
- content::WebContents* web_contents) OVERRIDE;
- virtual void RenderViewHostCreated(
- content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderProcessHostCreated(
- content::RenderProcessHost* host) OVERRIDE;
- virtual content::WebUIControllerFactory* GetWebUIControllerFactory() OVERRIDE;
- virtual GURL GetEffectiveURL(content::BrowserContext* browser_context,
- const GURL& url) OVERRIDE;
- virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
- const GURL& effective_url) OVERRIDE;
- virtual bool IsHandledURL(const GURL& url) OVERRIDE;
- virtual bool IsSuitableHost(content::RenderProcessHost* process_host,
- const GURL& site_url) OVERRIDE;
- virtual bool ShouldTryToUseExistingProcessHost(
- content::BrowserContext* browser_context, const GURL& url) OVERRIDE;
- virtual void SiteInstanceGotProcess(
- content::SiteInstance* site_instance) OVERRIDE;
- virtual void SiteInstanceDeleting(
- content::SiteInstance* site_instance) OVERRIDE;
- virtual bool ShouldSwapProcessesForNavigation(const GURL& current_url,
- const GURL& new_url) OVERRIDE;
-
- virtual std::string GetCanonicalEncodingNameByAliasName(
- const std::string& alias_name) OVERRIDE;
- virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
- int child_process_id) OVERRIDE;
- virtual std::string GetApplicationLocale() OVERRIDE;
- virtual std::string GetAcceptLangs(
- content::BrowserContext* context) OVERRIDE;
- virtual SkBitmap* GetDefaultFavicon() OVERRIDE;
- virtual bool AllowAppCache(const GURL& manifest_url,
- const GURL& first_party,
- content::ResourceContext* context) OVERRIDE;
- virtual bool AllowGetCookie(const GURL& url,
- const GURL& first_party,
- const net::CookieList& cookie_list,
- content::ResourceContext* context,
- int render_process_id,
- int render_view_id) OVERRIDE;
- virtual bool AllowSetCookie(const GURL& url,
- const GURL& first_party,
- const std::string& cookie_line,
- content::ResourceContext* context,
- int render_process_id,
- int render_view_id,
- net::CookieOptions* options) OVERRIDE;
- virtual bool AllowSaveLocalState(
- content::ResourceContext* context) OVERRIDE;
- virtual bool AllowWorkerDatabase(
- const GURL& url,
- const string16& name,
- const string16& display_name,
- unsigned long estimated_size,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) OVERRIDE;
- virtual bool AllowWorkerFileSystem(
- const GURL& url,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) OVERRIDE;
- virtual bool AllowWorkerIndexedDB(
- const GURL& url,
- const string16& name,
- content::ResourceContext* context,
- const std::vector<std::pair<int, int> >& render_views) OVERRIDE;
- virtual net::URLRequestContext* OverrideRequestContextForURL(
- const GURL& url, content::ResourceContext* context) OVERRIDE;
- virtual content::QuotaPermissionContext*
- CreateQuotaPermissionContext() OVERRIDE;
- virtual void OpenItem(const FilePath& path) OVERRIDE;
- virtual void ShowItemInFolder(const FilePath& path) OVERRIDE;
- virtual void AllowCertificateError(
- int render_process_id,
- int render_view_id,
- int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL& request_url,
- bool overridable,
- const base::Callback<void(bool)>& callback,
- bool* cancel_request) OVERRIDE;
- virtual void SelectClientCertificate(
- int render_process_id,
- int render_view_id,
- const net::HttpNetworkSession* network_session,
- net::SSLCertRequestInfo* cert_request_info,
- const base::Callback<void(net::X509Certificate*)>& callback) OVERRIDE;
- virtual void AddNewCertificate(
- net::URLRequest* request,
- net::X509Certificate* cert,
- int render_process_id,
- int render_view_id) OVERRIDE;
- virtual void RequestMediaAccessPermission(
- const content::MediaStreamRequest* request,
- const content::MediaResponseCallback& callback) OVERRIDE;
- virtual content::MediaObserver* GetMediaObserver() OVERRIDE;
- virtual void RequestDesktopNotificationPermission(
- const GURL& source_origin,
- int callback_context,
- int render_process_id,
- int render_view_id) OVERRIDE;
- virtual WebKit::WebNotificationPresenter::Permission
- CheckDesktopNotificationPermission(
- const GURL& origin,
- content::ResourceContext* context,
- int render_process_id) OVERRIDE;
- virtual void ShowDesktopNotification(
- const content::ShowDesktopNotificationHostMsgParams& params,
- int render_process_id,
- int render_view_id,
- bool worker) OVERRIDE;
- virtual void CancelDesktopNotification(
- int render_process_id,
- int render_view_id,
- int notification_id) OVERRIDE;
- virtual bool CanCreateWindow(
- const GURL& opener_url,
- const GURL& origin,
- WindowContainerType container_type,
- content::ResourceContext* context,
- int render_process_id,
- bool* no_javascript_access) OVERRIDE;
- virtual std::string GetWorkerProcessTitle(
- const GURL& url, content::ResourceContext* context) OVERRIDE;
- virtual void ResourceDispatcherHostCreated() OVERRIDE;
- virtual content::SpeechRecognitionManagerDelegate*
- GetSpeechRecognitionManagerDelegate() OVERRIDE;
- virtual ui::Clipboard* GetClipboard() OVERRIDE;
- virtual net::NetLog* GetNetLog() OVERRIDE;
- virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
- virtual bool IsFastShutdownPossible() OVERRIDE;
- virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh,
- const GURL& url,
- WebPreferences* prefs) OVERRIDE;
- virtual void UpdateInspectorSetting(content::RenderViewHost* rvh,
- const std::string& key,
- const std::string& value) OVERRIDE;
- virtual void ClearInspectorSettings(content::RenderViewHost* rvh) OVERRIDE;
- virtual void BrowserURLHandlerCreated(
- content::BrowserURLHandler* handler) OVERRIDE;
- virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE;
- virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE;
- virtual FilePath GetDefaultDownloadDirectory() OVERRIDE;
- virtual std::string GetDefaultDownloadName() OVERRIDE;
- virtual bool AllowSocketAPI(content::BrowserContext* browser_context,
- const GURL& url) OVERRIDE;
-
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
- virtual int GetCrashSignalFD(const CommandLine& command_line) OVERRIDE;
-#endif
-
-#if defined(OS_WIN)
- virtual const wchar_t* GetResourceDllName() OVERRIDE;
-#endif
-
-#if defined(USE_NSS)
- virtual
- crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate(
- const GURL& url) OVERRIDE;
-#endif
-
- content::ShellBrowserContext* browser_context();
-
- private:
- scoped_ptr<content::ShellResourceDispatcherHostDelegate>
- resource_dispatcher_host_delegate_;
-
- ExamplesBrowserMainParts* examples_browser_main_parts_;
-
- DISALLOW_COPY_AND_ASSIGN(ExamplesContentBrowserClient);
-};
-
-} // namespace examples
-} // namespace views
-
-#endif // UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
diff --git a/ui/views/examples/content_client/examples_main_delegate.cc b/ui/views/examples/content_client/examples_main_delegate.cc
deleted file mode 100644
index 4e84e67..0000000
--- a/ui/views/examples/content_client/examples_main_delegate.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/examples/content_client/examples_main_delegate.h"
-
-#include "base/command_line.h"
-#include "base/file_path.h"
-#include "base/path_service.h"
-#include "content/public/browser/browser_main_runner.h"
-#include "content/public/common/content_switches.h"
-#include "content/shell/shell_content_plugin_client.h"
-#include "content/shell/shell_content_renderer_client.h"
-#include "content/shell/shell_content_utility_client.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_paths.h"
-#include "ui/views/examples/content_client/examples_content_browser_client.h"
-
-namespace views {
-namespace examples {
-namespace {
-
-int ExamplesBrowserMain(
- const content::MainFunctionParams& main_function_params) {
- scoped_ptr<content::BrowserMainRunner> main_runner(
- content::BrowserMainRunner::Create());
- int exit_code = main_runner->Initialize(main_function_params);
- if (exit_code >= 0)
- return exit_code;
- exit_code = main_runner->Run();
- main_runner->Shutdown();
- return exit_code;
-}
-
-}
-
-ExamplesMainDelegate::ExamplesMainDelegate() {
-}
-
-ExamplesMainDelegate::~ExamplesMainDelegate() {
-}
-
-bool ExamplesMainDelegate::BasicStartupComplete(int* exit_code) {
- return false;
-}
-
-void ExamplesMainDelegate::PreSandboxStartup() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
-
- content::SetContentClient(&content_client_);
- InitializeShellContentClient(process_type);
-
- InitializeResourceBundle();
-}
-
-void ExamplesMainDelegate::SandboxInitialized(const std::string& process_type) {
-}
-
-int ExamplesMainDelegate::RunProcess(
- const std::string& process_type,
- const content::MainFunctionParams& main_function_params) {
- if (process_type != "")
- return -1;
-
- return ExamplesBrowserMain(main_function_params);
-}
-
-void ExamplesMainDelegate::ProcessExiting(const std::string& process_type) {
-}
-
-#if defined(OS_POSIX)
-content::ZygoteForkDelegate* ExamplesMainDelegate::ZygoteStarting() {
- return NULL;
-}
-
-void ExamplesMainDelegate::ZygoteForked() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- command_line.GetSwitchValueASCII(switches::kProcessType);
- InitializeShellContentClient(process_type);
-}
-#endif
-
-void ExamplesMainDelegate::InitializeShellContentClient(
- const std::string& process_type) {
- if (process_type.empty()) {
- browser_client_.reset(new ExamplesContentBrowserClient);
- content::GetContentClient()->set_browser(browser_client_.get());
- } else if (process_type == switches::kRendererProcess) {
- renderer_client_.reset(new content::ShellContentRendererClient);
- content::GetContentClient()->set_renderer(renderer_client_.get());
- } else if (process_type == switches::kPluginProcess) {
- plugin_client_.reset(new content::ShellContentPluginClient);
- content::GetContentClient()->set_plugin(plugin_client_.get());
- } else if (process_type == switches::kUtilityProcess) {
- utility_client_.reset(new content::ShellContentUtilityClient);
- content::GetContentClient()->set_utility(utility_client_.get());
- }
-}
-
-void ExamplesMainDelegate::InitializeResourceBundle() {
- ui::ResourceBundle::InitSharedInstanceWithLocale("en-US");
-}
-
-} // namespace examples
-} // namespace views
diff --git a/ui/views/examples/content_client/examples_main_delegate.h b/ui/views/examples/content_client/examples_main_delegate.h
deleted file mode 100644
index 7945223..0000000
--- a/ui/views/examples/content_client/examples_main_delegate.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_MAIN_DELEGATE_H_
-#define UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_MAIN_DELEGATE_H_
-#pragma once
-
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
-#include "content/shell/shell_content_client.h"
-#include "content/public/app/content_main_delegate.h"
-
-namespace content {
-class ShellContentRendererClient;
-class ShellContentPluginClient;
-class ShellContentUtilityClient;
-}
-
-namespace views {
-namespace examples {
-
-class ExamplesContentBrowserClient;
-
-class ExamplesMainDelegate : public content::ContentMainDelegate {
- public:
- ExamplesMainDelegate();
- virtual ~ExamplesMainDelegate();
-
- virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
- virtual void PreSandboxStartup() OVERRIDE;
- virtual void SandboxInitialized(const std::string& process_type) OVERRIDE;
- virtual int RunProcess(
- const std::string& process_type,
- const content::MainFunctionParams& main_function_params) OVERRIDE;
- virtual void ProcessExiting(const std::string& process_type) OVERRIDE;
-#if defined(OS_MACOSX)
- virtual bool ProcessRegistersWithSystemProcess(
- const std::string& process_type) OVERRIDE;
- virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE;
- virtual bool DelaySandboxInitialization(
- const std::string& process_type) OVERRIDE;
-#elif defined(OS_POSIX)
- virtual content::ZygoteForkDelegate* ZygoteStarting() OVERRIDE;
- virtual void ZygoteForked() OVERRIDE;
-#endif // OS_MACOSX
-
- private:
- void InitializeShellContentClient(const std::string& process_type);
- void InitializeResourceBundle();
-
- scoped_ptr<ExamplesContentBrowserClient> browser_client_;
- scoped_ptr<content::ShellContentRendererClient> renderer_client_;
- scoped_ptr<content::ShellContentPluginClient> plugin_client_;
- scoped_ptr<content::ShellContentUtilityClient> utility_client_;
- content::ShellContentClient content_client_;
-
- DISALLOW_COPY_AND_ASSIGN(ExamplesMainDelegate);
-};
-
-} // namespace examples
-} // namespace views
-
-#endif // UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_MAIN_DELEGATE_H_
diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc
index bd2fbf3..699f26f 100644
--- a/ui/views/examples/examples_main.cc
+++ b/ui/views/examples/examples_main.cc
@@ -2,23 +2,107 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/public/app/content_main.h"
-#include "sandbox/src/sandbox_types.h"
-#include "ui/views/examples/content_client/examples_main_delegate.h"
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/i18n/icu_util.h"
+#include "base/logging.h"
+#include "base/message_loop.h"
+#include "base/process_util.h"
+#include "base/stl_util.h"
+#include "base/utf_string_conversions.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_paths.h"
+#include "ui/views/examples/examples_window.h"
+#include "ui/views/focus/accelerator_handler.h"
+#include "ui/views/test/test_views_delegate.h"
+#include "ui/views/widget/widget.h"
#if defined(OS_WIN)
-#include "content/public/app/startup_helper_win.h"
+#include "ui/base/win/scoped_ole_initializer.h"
#endif
+#if defined(USE_AURA)
+#include "ui/aura/client/stacking_client.h"
+#include "ui/aura/env.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/compositor/compositor.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
+#include "ui/views/widget/native_widget_aura.h"
+#endif
+
+#if defined(USE_AURA)
+class RootWindowStackingClient : public aura::client::StackingClient {
+ public:
+ explicit RootWindowStackingClient() {
+ aura::client::SetStackingClient(this);
+ }
+
+ virtual ~RootWindowStackingClient() {
+ aura::client::SetStackingClient(NULL);
+ }
+
+ // Overridden from aura::client::StackingClient:
+ virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE {
+ return window->GetRootWindow();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RootWindowStackingClient);
+};
+#endif
+
+int main(int argc, char** argv) {
#if defined(OS_WIN)
-int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- content::InitializeSandboxInfo(&sandbox_info);
- views::examples::ExamplesMainDelegate delegate;
- return content::ContentMain(instance, &sandbox_info, &delegate);
-}
+ ui::ScopedOleInitializer ole_initializer;
+#endif
+ CommandLine::Init(argc, argv);
+
+ logging::InitLogging(NULL,
+ logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
+ logging::LOCK_LOG_FILE,
+ logging::DELETE_OLD_LOG_FILE,
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+
+ base::EnableTerminationOnHeapCorruption();
+
+ // The exit manager is in charge of calling the dtors of singleton objects.
+ base::AtExitManager exit_manager;
+
+ ui::RegisterPathProvider();
+ bool icu_result = icu_util::Initialize();
+ CHECK(icu_result);
+ ui::ResourceBundle::InitSharedInstanceWithLocale("en-US");
+
+ MessageLoop main_message_loop(MessageLoop::TYPE_UI);
+#if defined(USE_AURA)
+
+ // TURN ON THE HAX.
+ views::NativeWidgetAura::set_aura_desktop_hax();
+
+ ui::CompositorTestSupport::Initialize();
+
+ {
+ RootWindowStackingClient root_window_stacking_client;
+#endif
+
+ views::TestViewsDelegate delegate;
+
+ views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE);
+
+ // xxx: Hax here because this kills event handling.
+#if !defined(USE_AURA)
+ views::AcceleratorHandler accelerator_handler;
+ MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler);
#else
-int main(int argc, const char** argv) {
- views::examples::ExamplesMainDelegate delegate;
- return content::ContentMain(argc, argv, &delegate);
+ MessageLoopForUI::current()->Run();
+#endif
+
+#if defined(USE_AURA)
+ }
+ aura::Env::DeleteInstance();
+ ui::CompositorTestSupport::Terminate();
#endif
+
+ return 0;
+}
diff --git a/ui/views/examples/examples_window.cc b/ui/views/examples/examples_window.cc
index b78bdd0..4d763e6 100644
--- a/ui/views/examples/examples_window.cc
+++ b/ui/views/examples/examples_window.cc
@@ -11,7 +11,6 @@
#include "base/process_util.h"
#include "base/stl_util.h"
#include "base/utf_string_conversions.h"
-#include "content/public/browser/browser_context.h"
#include "ui/base/models/combobox_model.h"
#include "ui/base/ui_base_paths.h"
#include "ui/views/controls/button/text_button.h"
@@ -38,7 +37,6 @@
#include "ui/views/examples/textfield_example.h"
#include "ui/views/examples/throbber_example.h"
#include "ui/views/examples/tree_view_example.h"
-#include "ui/views/examples/webview_example.h"
#include "ui/views/examples/widget_example.h"
#include "ui/views/focus/accelerator_handler.h"
#include "ui/views/layout/fill_layout.h"
@@ -78,13 +76,11 @@ class ComboboxModelExampleList : public ui::ComboboxModel {
class ExamplesWindowContents : public WidgetDelegateView,
public ComboboxListener {
public:
-ExamplesWindowContents(Operation operation,
- content::BrowserContext* browser_context)
+ explicit ExamplesWindowContents(Operation operation)
: combobox_(new Combobox(&combobox_model_)),
example_shown_(new View),
status_label_(new Label),
- operation_(operation),
- browser_context_(browser_context) {
+ operation_(operation) {
instance_ = this;
combobox_->set_listener(this);
}
@@ -182,7 +178,6 @@ ExamplesWindowContents(Operation operation,
combobox_model_.AddExample(new TextfieldExample);
combobox_model_.AddExample(new ThrobberExample);
combobox_model_.AddExample(new TreeViewExample);
- combobox_model_.AddExample(new WebViewExample(browser_context_));
combobox_model_.AddExample(new WidgetExample);
}
@@ -192,7 +187,6 @@ ExamplesWindowContents(Operation operation,
View* example_shown_;
Label* status_label_;
const Operation operation_;
- content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents);
};
@@ -200,13 +194,11 @@ ExamplesWindowContents(Operation operation,
// static
ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL;
-void ShowExamplesWindow(Operation operation,
- content::BrowserContext* browser_context) {
+void ShowExamplesWindow(Operation operation) {
if (ExamplesWindowContents::instance()) {
ExamplesWindowContents::instance()->GetWidget()->Activate();
} else {
- Widget::CreateWindowWithBounds(new ExamplesWindowContents(operation,
- browser_context),
+ Widget::CreateWindowWithBounds(new ExamplesWindowContents(operation),
gfx::Rect(0, 0, 850, 300))->Show();
}
}
diff --git a/ui/views/examples/examples_window.h b/ui/views/examples/examples_window.h
index cdfe2be..33a6d6f 100644
--- a/ui/views/examples/examples_window.h
+++ b/ui/views/examples/examples_window.h
@@ -6,10 +6,6 @@
#define UI_VIEWS_EXAMPLES_EXAMPLES_WINDOW_H_
#pragma once
-namespace content {
-class BrowserContext;
-}
-
namespace views {
namespace examples {
@@ -19,8 +15,7 @@ enum Operation {
};
// Shows a window with the views examples in it.
-void ShowExamplesWindow(Operation operation,
- content::BrowserContext* browser_context);
+void ShowExamplesWindow(Operation operation);
} // namespace examples
} // namespace views
diff --git a/ui/views/examples/webview_example.cc b/ui/views/examples/webview_example.cc
deleted file mode 100644
index 55ae0af..0000000
--- a/ui/views/examples/webview_example.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/examples/webview_example.h"
-
-#include "base/utf_string_conversions.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/navigation_controller.h"
-#include "grit/ui_resources.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/views/layout/fill_layout.h"
-#include "ui/views/controls/webview/webview.h"
-
-namespace views {
-namespace examples {
-
-WebViewExample::WebViewExample(content::BrowserContext* browser_context)
- : ExampleBase("WebView"),
- webview_(NULL),
- browser_context_(browser_context) {
-}
-
-WebViewExample::~WebViewExample() {
-}
-
-void WebViewExample::CreateExampleView(View* container) {
- webview_ = new WebView(browser_context_);
- container->SetLayoutManager(new FillLayout);
- container->AddChildView(webview_);
-
- webview_->web_contents()->GetController().LoadURL(
- GURL("http://www.google.com/"),
- content::Referrer(),
- content::PAGE_TRANSITION_TYPED,
- std::string());
- webview_->web_contents()->Focus();
-}
-
-} // namespace examples
-} // namespace views
diff --git a/ui/views/examples/webview_example.h b/ui/views/examples/webview_example.h
deleted file mode 100644
index 444b7f4..0000000
--- a/ui/views/examples/webview_example.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 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 UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
-#define UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "ui/views/examples/example_base.h"
-
-namespace content {
-class BrowserContext;
-}
-
-namespace views {
-class WebView;
-
-namespace examples {
-
-class WebViewExample : public ExampleBase {
- public:
- explicit WebViewExample(content::BrowserContext* browser_context);
- virtual ~WebViewExample();
-
- // Overridden from ExampleBase:
- virtual void CreateExampleView(View* container) OVERRIDE;
-
- private:
- WebView* webview_;
- content::BrowserContext* browser_context_;
-
- DISALLOW_COPY_AND_ASSIGN(WebViewExample);
-};
-
-} // namespace examples
-} // namespace views
-
-#endif // UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
diff --git a/ui/views/views.gyp b/ui/views/views.gyp
index 06ef29f..cb82298 100644
--- a/ui/views/views.gyp
+++ b/ui/views/views.gyp
@@ -29,7 +29,6 @@
'../../base/base.gyp:base_i18n',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../build/temp_gyp/googleurl.gyp:googleurl',
- '../../content/content.gyp:content_browser',
'../../net/net.gyp:net',
'../../skia/skia.gyp:skia',
'../../third_party/icu/icu.gyp:icui18n',
@@ -230,8 +229,6 @@
'controls/tree/tree_view_views.h',
'controls/tree/tree_view_win.cc',
'controls/tree/tree_view_win.h',
- 'controls/webview/webview.cc',
- 'controls/webview/webview.h',
#'debug_utils.cc',
#'debug_utils.h',
'drag_controller.h',
@@ -546,9 +543,7 @@
'dependencies': [
'../../base/base.gyp:base',
'../../base/base.gyp:base_i18n',
- '../../build/temp_gyp/googleurl.gyp:googleurl',
'../../chrome/chrome_resources.gyp:packed_resources',
- '../../content/content.gyp:content_browser',
'../../skia/skia.gyp:skia',
'../../third_party/icu/icu.gyp:icui18n',
'../../third_party/icu/icu.gyp:icuuc',
@@ -611,8 +606,6 @@
'examples/throbber_example.h',
'examples/tree_view_example.cc',
'examples/tree_view_example.h',
- 'examples/webview_example.cc',
- 'examples/webview_example.h',
'examples/widget_example.cc',
'examples/widget_example.h',
],
@@ -631,7 +624,6 @@
'../../base/base.gyp:base',
'../../base/base.gyp:base_i18n',
'../../chrome/chrome_resources.gyp:packed_resources',
- '../../content/content.gyp:content_shell_lib',
'../../skia/skia.gyp:skia',
'../../third_party/icu/icu.gyp:icui18n',
'../../third_party/icu/icu.gyp:icuuc',
@@ -645,13 +637,6 @@
'../..',
],
'sources': [
- '../../content/app/startup_helper_win.cc',
- 'examples/content_client/examples_browser_main_parts.cc',
- 'examples/content_client/examples_browser_main_parts.h',
- 'examples/content_client/examples_content_browser_client.cc',
- 'examples/content_client/examples_content_browser_client.h',
- 'examples/content_client/examples_main_delegate.cc',
- 'examples/content_client/examples_main_delegate.h',
'examples/examples_main.cc',
'test/test_views_delegate.cc',
'test/test_views_delegate.h',
@@ -671,13 +656,7 @@
'VCManifestTool': {
'AdditionalManifestFiles': 'examples\\views_examples.exe.manifest',
},
- 'VCLinkerTool': {
- 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
- },
},
- 'dependencies': [
- '../../sandbox/sandbox.gyp:sandbox',
- ],
}],
['use_aura==1', {
'dependencies': [