summaryrefslogtreecommitdiffstats
path: root/ash/shell
diff options
context:
space:
mode:
authorrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 17:20:18 +0000
committerrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 17:20:18 +0000
commitd54f8a4a7b186b3fdcfcee666b8fadd16f575576 (patch)
tree4181b434ebcdd7749b4895fabf913c50c48806d3 /ash/shell
parentfcec95ae1cd54e26944bc8821d8356642662e64e (diff)
downloadchromium_src-d54f8a4a7b186b3fdcfcee666b8fadd16f575576.zip
chromium_src-d54f8a4a7b186b3fdcfcee666b8fadd16f575576.tar.gz
chromium_src-d54f8a4a7b186b3fdcfcee666b8fadd16f575576.tar.bz2
Re-implement the screensaver to use WebView instead of ExtensionDialogHost.
Use WebView to render the screensaver extension instead of ExtensionDialogHost. Using the RenderViewGone override to detect termination of the renderer process to restart it. Added browser tests. R=ben@chromium.org,sky@chromium.org BUG=chromium-os:28211 TEST=Tested that the screensaver comes up; tested the reload via crashing the extension renderer with SIG_ABRT; also ran browser tests. Review URL: https://chromiumcodereview.appspot.com/10191010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell')
-rw-r--r--ash/shell/shell_delegate_impl.cc4
-rw-r--r--ash/shell/shell_delegate_impl.h1
-rw-r--r--ash/shell/window_type_launcher.cc17
-rw-r--r--ash/shell/window_type_launcher.h1
4 files changed, 22 insertions, 1 deletions
diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc
index 9cafd1e..31edb6a 100644
--- a/ash/shell/shell_delegate_impl.cc
+++ b/ash/shell/shell_delegate_impl.cc
@@ -75,6 +75,10 @@ void ShellDelegateImpl::OpenCrosh() {
void ShellDelegateImpl::OpenMobileSetup() {
}
+content::BrowserContext* ShellDelegateImpl::GetCurrentBrowserContext() {
+ return Shell::GetInstance()->browser_context();
+}
+
void ShellDelegateImpl::ToggleSpokenFeedback() {
}
diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h
index 66f8c36..71b65b2 100644
--- a/ash/shell/shell_delegate_impl.h
+++ b/ash/shell/shell_delegate_impl.h
@@ -33,6 +33,7 @@ class ShellDelegateImpl : public ash::ShellDelegate {
virtual void OpenFileManager() OVERRIDE;
virtual void OpenCrosh() OVERRIDE;
virtual void OpenMobileSetup() OVERRIDE;
+ virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE;
virtual void ToggleSpokenFeedback() OVERRIDE;
virtual ash::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE;
virtual void StartPartialScreenshot(
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index f3abad2..020ec00 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -4,6 +4,7 @@
#include "ash/shell/window_type_launcher.h"
+#include "ash/screensaver/screensaver_view.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
@@ -11,7 +12,10 @@
#include "ash/shell/panel_window.h"
#include "ash/shell/toplevel_window.h"
#include "ash/wm/shadow_types.h"
+#include "base/bind.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "content/public/browser/browser_thread.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/gfx/canvas.h"
@@ -216,7 +220,10 @@ WindowTypeLauncher::WindowTypeLauncher()
this, ASCIIToUTF16("Open Views Examples Window")))),
ALLOW_THIS_IN_INITIALIZER_LIST(show_hide_window_button_(
new views::NativeTextButton(
- this, ASCIIToUTF16("Show/Hide a Window")))) {
+ this, ASCIIToUTF16("Show/Hide a Window")))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(show_screensaver_(
+ new views::NativeTextButton(
+ this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]")))) {
views::GridLayout* layout = new views::GridLayout(this);
layout->SetInsets(5, 5, 5, 5);
SetLayoutManager(layout);
@@ -239,6 +246,7 @@ WindowTypeLauncher::WindowTypeLauncher()
AddViewToLayout(layout, transient_button_);
AddViewToLayout(layout, examples_button_);
AddViewToLayout(layout, show_hide_window_button_);
+ AddViewToLayout(layout, show_screensaver_);
#if !defined(OS_MACOSX)
set_context_menu_controller(this);
#endif
@@ -305,6 +313,13 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender,
NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView());
} else if (sender == show_hide_window_button_) {
NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView());
+ } else if (sender == show_screensaver_) {
+ ash::ShowScreensaver(GURL("http://www.google.com"));
+ content::BrowserThread::PostDelayedTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&ash::CloseScreensaver),
+ base::TimeDelta::FromSeconds(5));
+
}
#if !defined(OS_MACOSX)
else if (sender == examples_button_) {
diff --git a/ash/shell/window_type_launcher.h b/ash/shell/window_type_launcher.h
index 3b9807d..4dcc5ab 100644
--- a/ash/shell/window_type_launcher.h
+++ b/ash/shell/window_type_launcher.h
@@ -77,6 +77,7 @@ class WindowTypeLauncher : public views::WidgetDelegateView,
views::NativeTextButton* transient_button_;
views::NativeTextButton* examples_button_;
views::NativeTextButton* show_hide_window_button_;
+ views::NativeTextButton* show_screensaver_;
#if !defined(OS_MACOSX)
scoped_ptr<views::MenuRunner> menu_runner_;
#endif