diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/content_shell.gypi | 3 | ||||
-rw-r--r-- | content/shell/DEPS | 6 | ||||
-rw-r--r-- | content/shell/browser/minimal_shell.cc | 56 | ||||
-rw-r--r-- | content/shell/browser/minimal_shell.h | 69 | ||||
-rw-r--r-- | content/shell/browser/shell.h | 12 | ||||
-rw-r--r-- | content/shell/browser/shell_aura.cc | 6 |
6 files changed, 16 insertions, 136 deletions
diff --git a/content/content_shell.gypi b/content/content_shell.gypi index 6485682..efd102f 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -77,8 +77,6 @@ 'shell/app/webkit_test_platform_support_linux.cc', 'shell/app/webkit_test_platform_support_mac.mm', 'shell/app/webkit_test_platform_support_win.cc', - 'shell/browser/minimal_shell.cc', - 'shell/browser/minimal_shell.h', 'shell/browser/notify_done_forwarder.cc', 'shell/browser/notify_done_forwarder.h', 'shell/browser/shell_android.cc', @@ -233,6 +231,7 @@ ['chromeos==1', { 'dependencies': [ '../chromeos/chromeos.gyp:chromeos', + '../ui/shell/shell.gyp:shell', ], }], # chromeos==1 ['use_ash==1', { diff --git a/content/shell/DEPS b/content/shell/DEPS index 5385a5d..cd6dea8 100644 --- a/content/shell/DEPS +++ b/content/shell/DEPS @@ -23,3 +23,9 @@ include_rules = [ # For WebTestRunner library "+third_party/WebKit/public/testing", ] + +specific_include_rules = { + "shell_aura\.cc": [ + "+ui/shell" + ], +} diff --git a/content/shell/browser/minimal_shell.cc b/content/shell/browser/minimal_shell.cc deleted file mode 100644 index cc719db..0000000 --- a/content/shell/browser/minimal_shell.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2013 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 "content/shell/browser/minimal_shell.h" - -#include "ui/aura/client/default_capture_client.h" -#include "ui/aura/env.h" -#include "ui/aura/focus_manager.h" -#include "ui/aura/root_window.h" -#include "ui/aura/test/test_activation_client.h" -#include "ui/views/corewm/compound_event_filter.h" -#include "ui/views/corewm/input_method_event_filter.h" - -namespace content { - -MinimalShell::MinimalShell(const gfx::Size& default_window_size) { - aura::Env::CreateInstance(); - root_window_.reset(new aura::RootWindow( - aura::RootWindow::CreateParams( - gfx::Rect(default_window_size)))); - root_window_->Init(); - aura::client::SetStackingClient(root_window_.get(), this); - - focus_client_.reset(new aura::FocusManager); - aura::client::SetFocusClient(root_window_.get(), focus_client_.get()); - - root_window_event_filter_ = new views::corewm::CompoundEventFilter; - // Pass ownership of the filter to the root_window. - root_window_->SetEventFilter(root_window_event_filter_); - - input_method_filter_.reset(new views::corewm::InputMethodEventFilter( - root_window_->GetAcceleratedWidget())); - input_method_filter_->SetInputMethodPropertyInRootWindow( - root_window_.get()); - root_window_event_filter_->AddHandler(input_method_filter_.get()); - - test_activation_client_.reset( - new aura::test::TestActivationClient(root_window_.get())); - - capture_client_.reset( - new aura::client::DefaultCaptureClient(root_window_.get())); -} - -MinimalShell::~MinimalShell() { - root_window_event_filter_->RemoveHandler(input_method_filter_.get()); -} - -aura::Window* MinimalShell::GetDefaultParent( - aura::Window* context, - aura::Window* window, - const gfx::Rect& bounds) { - return root_window_.get(); -} - -} // namespace content diff --git a/content/shell/browser/minimal_shell.h b/content/shell/browser/minimal_shell.h deleted file mode 100644 index e316fe0..0000000 --- a/content/shell/browser/minimal_shell.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2013 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 CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_ -#define CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_ - -#include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" -#include "ui/aura/client/stacking_client.h" - -namespace aura { -class RootWindow; -class Window; -namespace client { -class DefaultCaptureClient; -class FocusClient; -} -namespace test { -class TestActivationClient; -} -} - -namespace gfx { -class Rect; -class Size; -} - -namespace views { -namespace corewm { -class CompoundEventFilter; -class InputMethodEventFilter; -} -} - -namespace content { - -// Creates a minimal environment for running the shell. We can't pull in all of -// ash here, but we can create attach several of the same things we'd find in -// the ash parts of the code. -class MinimalShell : public aura::client::StackingClient { - public: - explicit MinimalShell(const gfx::Size& default_window_size); - virtual ~MinimalShell(); - - aura::RootWindow* root_window() { return root_window_.get(); } - - // Overridden from client::StackingClient: - virtual aura::Window* GetDefaultParent(aura::Window* context, - aura::Window* window, - const gfx::Rect& bounds) OVERRIDE; - - private: - scoped_ptr<aura::RootWindow> root_window_; - - // Owned by RootWindow - views::corewm::CompoundEventFilter* root_window_event_filter_; - - scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; - scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_; - scoped_ptr<aura::test::TestActivationClient> test_activation_client_; - scoped_ptr<aura::client::FocusClient> focus_client_; - - DISALLOW_COPY_AND_ASSIGN(MinimalShell); -}; - -} // namespace content; - -#endif // CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_ diff --git a/content/shell/browser/shell.h b/content/shell/browser/shell.h index 29cbaa7..86c4497 100644 --- a/content/shell/browser/shell.h +++ b/content/shell/browser/shell.h @@ -26,15 +26,15 @@ typedef struct _GtkToolItem GtkToolItem; #include "base/android/scoped_java_ref.h" #elif defined(USE_AURA) #if defined(OS_CHROMEOS) -namespace content { +namespace shell { class MinimalShell; -} -#endif +} // namespace shell +#endif // defined(OS_CHROMEOS) namespace views { class Widget; class ViewsDelegate; -} -#endif +} // namespace views +#endif // defined(USE_AURA) class GURL; namespace content { @@ -252,7 +252,7 @@ class Shell : public WebContentsDelegate, base::android::ScopedJavaGlobalRef<jobject> java_object_; #elif defined(USE_AURA) #if defined(OS_CHROMEOS) - static content::MinimalShell* minimal_shell_; + static shell::MinimalShell* minimal_shell_; #endif static views::ViewsDelegate* views_delegate_; diff --git a/content/shell/browser/shell_aura.cc b/content/shell/browser/shell_aura.cc index da8460e..7d8309a 100644 --- a/content/shell/browser/shell_aura.cc +++ b/content/shell/browser/shell_aura.cc @@ -30,8 +30,8 @@ #if defined(OS_CHROMEOS) #include "chromeos/dbus/dbus_thread_manager.h" -#include "content/shell/browser/minimal_shell.h" #include "ui/aura/test/test_screen.h" +#include "ui/shell/minimal_shell.h" #endif #if defined(OS_WIN) @@ -278,7 +278,7 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, } // namespace #if defined(OS_CHROMEOS) -MinimalShell* Shell::minimal_shell_ = NULL; +shell::MinimalShell* Shell::minimal_shell_ = NULL; #endif views::ViewsDelegate* Shell::views_delegate_ = NULL; @@ -292,7 +292,7 @@ void Shell::PlatformInitialize(const gfx::Size& default_window_size) { chromeos::DBusThreadManager::Initialize(); gfx::Screen::SetScreenInstance( gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); - minimal_shell_ = new content::MinimalShell(default_window_size); + minimal_shell_ = new shell::MinimalShell(default_window_size); #else gfx::Screen::SetScreenInstance( gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |