summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mojo/examples/aura_demo/root_window_host_mojo.cc4
-rw-r--r--mojo/examples/launcher/launcher.cc64
-rw-r--r--mojo/examples/launcher/launcher.mojom19
-rw-r--r--mojo/examples/view_manager/DEPS4
-rw-r--r--mojo/examples/view_manager/view_manager.cc191
-rw-r--r--mojo/examples/view_manager/view_manager.mojom28
-rw-r--r--mojo/mojo.gyp1
-rw-r--r--mojo/mojo_examples.gypi50
-rw-r--r--mojo/services/native_viewport/native_viewport.h1
-rw-r--r--mojo/services/native_viewport/native_viewport.mojom1
-rw-r--r--mojo/services/native_viewport/native_viewport_android.cc4
-rw-r--r--mojo/services/native_viewport/native_viewport_android.h1
-rw-r--r--mojo/services/native_viewport/native_viewport_mac.mm4
-rw-r--r--mojo/services/native_viewport/native_viewport_service.cc6
-rw-r--r--mojo/services/native_viewport/native_viewport_stub.cc2
-rw-r--r--mojo/services/native_viewport/native_viewport_win.cc6
-rw-r--r--mojo/services/native_viewport/native_viewport_x11.cc4
17 files changed, 377 insertions, 13 deletions
diff --git a/mojo/examples/aura_demo/root_window_host_mojo.cc b/mojo/examples/aura_demo/root_window_host_mojo.cc
index 86794f2..7e09d8d 100644
--- a/mojo/examples/aura_demo/root_window_host_mojo.cc
+++ b/mojo/examples/aura_demo/root_window_host_mojo.cc
@@ -72,11 +72,13 @@ gfx::AcceleratedWidget WindowTreeHostMojo::GetAcceleratedWidget() {
}
void WindowTreeHostMojo::Show() {
+ window()->Show();
native_viewport_->Show();
}
void WindowTreeHostMojo::Hide() {
- NOTIMPLEMENTED();
+ native_viewport_->Hide();
+ window()->Hide();
}
void WindowTreeHostMojo::ToggleFullScreen() {
diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
index 891c7b4..85ea602 100644
--- a/mojo/examples/launcher/launcher.cc
+++ b/mojo/examples/launcher/launcher.cc
@@ -20,6 +20,7 @@
#include "mojo/public/gles2/gles2_cpp.h"
#include "mojo/public/system/core.h"
#include "mojo/public/system/macros.h"
+#include "mojom/launcher.h"
#include "mojom/native_viewport.h"
#include "mojom/shell.h"
#include "ui/aura/client/aura_constants.h"
@@ -140,9 +141,19 @@ class LauncherWindowTreeClient : public aura::client::WindowTreeClient {
DISALLOW_COPY_AND_ASSIGN(LauncherWindowTreeClient);
};
+// Called when the user has submitted a URL by pressing Enter.
+class URLReceiver {
+ public:
+ virtual void OnURLEntered(const std::string& url_text) = 0;
+
+ protected:
+ virtual ~URLReceiver() {}
+};
+
class LauncherController : public views::TextfieldController {
public:
- LauncherController() {}
+ explicit LauncherController(URLReceiver* url_receiver)
+ : url_receiver_(url_receiver) {}
void InitInWindow(aura::Window* parent) {
views::Widget* widget = new views::Widget;
@@ -163,6 +174,7 @@ class LauncherController : public views::TextfieldController {
views::Textfield* textfield = new views::Textfield;
textfield->set_controller(this);
container->AddChildView(textfield);
+ textfield->RequestFocus();
container->Layout();
@@ -175,18 +187,25 @@ class LauncherController : public views::TextfieldController {
const ui::KeyEvent& key_event) OVERRIDE {
if (key_event.key_code() == ui::VKEY_RETURN) {
GURL url(sender->text());
- printf("URL: %s\n", url.spec().c_str());
+ printf("Enter pressed with URL: %s\n", url.spec().c_str());
+ url_receiver_->OnURLEntered(url.spec());
}
return false;
}
+ URLReceiver* url_receiver_;
+
DISALLOW_COPY_AND_ASSIGN(LauncherController);
};
-class Launcher : public ShellClient {
+class LauncherImpl : public ShellClient,
+ public Launcher,
+ public URLReceiver {
public:
- explicit Launcher(ScopedMessagePipeHandle shell_handle)
- : shell_(shell_handle.Pass(), this) {
+ explicit LauncherImpl(ScopedMessagePipeHandle shell_handle)
+ : launcher_controller_(this),
+ shell_(shell_handle.Pass(), this),
+ pending_show_(false) {
screen_.reset(DemoScreen::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
@@ -194,16 +213,35 @@ class Launcher : public ShellClient {
CreateMessagePipe(&client_handle, &native_viewport_handle);
root_window_host_.reset(new WindowTreeHostMojo(
native_viewport_handle.Pass(), gfx::Rect(50, 50, 450, 60),
- base::Bind(&Launcher::HostContextCreated, base::Unretained(this))));
+ base::Bind(&LauncherImpl::HostContextCreated, base::Unretained(this))));
AllocationScope scope;
shell_->Connect("mojo:mojo_native_viewport_service", client_handle.Pass());
}
+ private:
+ // Overridden from ShellClient:
virtual void AcceptConnection(ScopedMessagePipeHandle handle) MOJO_OVERRIDE {
- NOTREACHED() << "Launcher can't be connected to.";
+ launcher_client_.reset(handle.Pass(), this);
+ }
+
+ // Overridden from Launcher:
+ virtual void Show() OVERRIDE {
+ if (!root_window_.get()) {
+ pending_show_ = true;
+ return;
+ }
+ root_window_->host()->Show();
+ }
+ virtual void Hide() OVERRIDE {
+ root_window_->host()->Hide();
+ }
+
+ // Overridden from URLReceiver:
+ virtual void OnURLEntered(const std::string& url_text) {
+ AllocationScope scope;
+ launcher_client_->OnURLEntered(url_text);
}
- private:
void HostContextCreated() {
aura::RootWindow::CreateParams params(gfx::Rect(450, 60));
params.host = root_window_host_.get();
@@ -225,7 +263,10 @@ class Launcher : public ShellClient {
launcher_controller_.InitInWindow(root_window_->window());
- root_window_->host()->Show();
+ if (pending_show_) {
+ pending_show_ = false;
+ Show();
+ }
}
scoped_ptr<DemoScreen> screen_;
@@ -238,8 +279,11 @@ class Launcher : public ShellClient {
LauncherController launcher_controller_;
RemotePtr<Shell> shell_;
+ RemotePtr<LauncherClient> launcher_client_;
scoped_ptr<WindowTreeHostMojo> root_window_host_;
scoped_ptr<aura::RootWindow> root_window_;
+
+ bool pending_show_;
};
} // namespace examples
@@ -264,7 +308,7 @@ extern "C" LAUNCHER_EXPORT MojoResult CDECL MojoMain(
// MessageLoop is not of TYPE_UI. I think we need a way to build
// Aura that doesn't define platform-specific stuff.
aura::Env::CreateInstance();
- mojo::examples::Launcher launcher(
+ mojo::examples::LauncherImpl launcher(
mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass());
loop.Run();
diff --git a/mojo/examples/launcher/launcher.mojom b/mojo/examples/launcher/launcher.mojom
new file mode 100644
index 0000000..d43692d
--- /dev/null
+++ b/mojo/examples/launcher/launcher.mojom
@@ -0,0 +1,19 @@
+// Copyright 2014 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.
+
+module mojo {
+
+[Peer=LauncherClient]
+interface Launcher {
+ void Show();
+ void Hide();
+};
+
+[Peer=Launcher]
+interface LauncherClient {
+ // Called when the user has requested |url| be launched.
+ void OnURLEntered(string url);
+};
+
+}
diff --git a/mojo/examples/view_manager/DEPS b/mojo/examples/view_manager/DEPS
new file mode 100644
index 0000000..8cb61f5
--- /dev/null
+++ b/mojo/examples/view_manager/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ "+ui/events",
+ "+ui/gfx",
+]
diff --git a/mojo/examples/view_manager/view_manager.cc b/mojo/examples/view_manager/view_manager.cc
new file mode 100644
index 0000000..9dfba22
--- /dev/null
+++ b/mojo/examples/view_manager/view_manager.cc
@@ -0,0 +1,191 @@
+// Copyright 2014 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 <stdio.h>
+
+#include "base/logging.h"
+#include "base/memory/scoped_vector.h"
+#include "base/message_loop/message_loop.h"
+#include "mojo/public/bindings/allocation_scope.h"
+#include "mojo/public/bindings/remote_ptr.h"
+#include "mojo/public/system/core.h"
+#include "mojo/public/system/macros.h"
+#include "mojo/services/native_viewport/geometry_conversions.h"
+#include "mojom/launcher.h"
+#include "mojom/native_viewport.h"
+#include "mojom/shell.h"
+#include "mojom/view_manager.h"
+#include "ui/events/event_constants.h"
+#include "ui/events/keycodes/keyboard_codes.h"
+#include "ui/gfx/rect.h"
+
+#if defined(WIN32)
+#if !defined(CDECL)
+#define CDECL __cdecl)
+#endif
+#define VIEW_MANAGER_EXPORT __declspec(dllexport)
+#else
+#define CDECL
+#define VIEW_MANAGER_EXPORT __attribute__((visibility("default")))
+#endif
+
+namespace mojo {
+namespace examples {
+
+// Convenience interface to connect to a service. Necessary because all code for
+// this app lives in one .cc file.
+class Connector {
+ public:
+ virtual void Connect(const String& url,
+ ScopedMessagePipeHandle client_handle) = 0;
+
+ protected:
+ virtual ~Connector() {}
+};
+
+class NativeViewportClientImpl : public NativeViewportClient,
+ public LauncherClient {
+ public:
+ explicit NativeViewportClientImpl(Connector* connector)
+ : connector_(connector) {
+ AllocationScope scope;
+ ScopedMessagePipeHandle client_handle, native_viewport_handle;
+ CreateMessagePipe(&client_handle, &native_viewport_handle);
+ connector_->Connect("mojo:mojo_native_viewport_service",
+ client_handle.Pass());
+ native_viewport_.reset(native_viewport_handle.Pass(), this);
+
+ native_viewport_->Create(gfx::Rect(50, 50, 800, 600));
+ native_viewport_->Show();
+ }
+ virtual ~NativeViewportClientImpl() {}
+
+ private:
+ // Overridden from NativeViewportClient:
+ virtual void OnCreated() OVERRIDE {
+ }
+ virtual void OnDestroyed() OVERRIDE {
+ base::MessageLoop::current()->Quit();
+ }
+ virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE {
+ // TODO(beng):
+ }
+ virtual void OnEvent(const Event& event) OVERRIDE {
+ if (!event.location().is_null())
+ native_viewport_->AckEvent(event);
+ if (event.action() == ui::ET_KEY_RELEASED) {
+ if (event.key_data().key_code() == ui::VKEY_L &&
+ (event.flags() & ui::EF_CONTROL_DOWN)) {
+ InitLauncher();
+ launcher_->Show();
+ }
+ }
+ }
+
+ // Overridden from LauncherClient:
+ virtual void OnURLEntered(const mojo::String& url) OVERRIDE {
+ std::string url_spec = url.To<std::string>();
+ printf("Received URL from launcher app: %s\n", url_spec.c_str());
+ launcher_->Hide();
+ }
+
+ void InitLauncher() {
+ if (!launcher_.is_null())
+ return;
+ AllocationScope scope;
+ ScopedMessagePipeHandle client_handle, native_viewport_handle;
+ CreateMessagePipe(&client_handle, &native_viewport_handle);
+ connector_->Connect("mojo:mojo_launcher", client_handle.Pass());
+ launcher_.reset(native_viewport_handle.Pass(), this);
+ }
+
+ Connector* connector_;
+ RemotePtr<NativeViewport> native_viewport_;
+ RemotePtr<Launcher> launcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(NativeViewportClientImpl);
+};
+
+class ViewImpl : public View {
+ public:
+ explicit ViewImpl(ScopedMessagePipeHandle handle)
+ : id_(-1),
+ client_(handle.Pass()) {}
+
+ private:
+ // Overridden from View:
+ virtual void SetId(int view_id) MOJO_OVERRIDE {
+ id_ = view_id;
+ }
+ virtual void GetId() MOJO_OVERRIDE {
+ client_->OnGotId(id_);
+ }
+
+ int id_;
+ RemotePtr<ViewClient> client_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewImpl);
+};
+
+class ViewManagerImpl : public ViewManager {
+ public:
+ explicit ViewManagerImpl(ScopedMessagePipeHandle handle)
+ : client_(handle.Pass()) {
+ }
+ virtual ~ViewManagerImpl() {}
+
+ private:
+ // Overridden from ViewManager:
+ virtual void CreateView() MOJO_OVERRIDE {
+ ScopedMessagePipeHandle server_handle, client_handle;
+ CreateMessagePipe(&server_handle, &client_handle);
+ views_.push_back(new ViewImpl(server_handle.Pass()));
+ client_->OnViewCreated(client_handle.Pass());
+ }
+
+ RemotePtr<ViewManagerClient> client_;
+ ScopedVector<ViewImpl> views_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewManagerImpl);
+};
+
+class ViewManager : public ShellClient,
+ public Connector {
+ public:
+ explicit ViewManager(ScopedMessagePipeHandle shell_handle)
+ : shell_(shell_handle.Pass(), this) {
+ nvc_.reset(new NativeViewportClientImpl(this));
+ }
+
+ private:
+ // Overridden from ShellClient:
+ virtual void AcceptConnection(ScopedMessagePipeHandle handle) MOJO_OVERRIDE {
+ view_managers_.push_back(new ViewManagerImpl(handle.Pass()));
+ }
+
+ // Overridden from Connector:
+ virtual void Connect(const String& url,
+ ScopedMessagePipeHandle client_handle) OVERRIDE {
+ shell_->Connect(url, client_handle.Pass());
+ }
+
+ RemotePtr<Shell> shell_;
+ scoped_ptr<NativeViewportClientImpl> nvc_;
+ ScopedVector<ViewManagerImpl> view_managers_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewManager);
+};
+
+} // namespace examples
+} // namespace mojo
+
+extern "C" VIEW_MANAGER_EXPORT MojoResult CDECL MojoMain(
+ MojoHandle shell_handle) {
+ base::MessageLoop loop;
+ mojo::examples::ViewManager view_manager(
+ mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass());
+ loop.Run();
+
+ return MOJO_RESULT_OK;
+}
diff --git a/mojo/examples/view_manager/view_manager.mojom b/mojo/examples/view_manager/view_manager.mojom
new file mode 100644
index 0000000..966474f
--- /dev/null
+++ b/mojo/examples/view_manager/view_manager.mojom
@@ -0,0 +1,28 @@
+// Copyright 2014 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.
+
+module mojo {
+
+[Peer=ViewClient]
+interface View {
+ void SetId(int32 id);
+ void GetId();
+};
+
+[Peer=View]
+interface ViewClient {
+ void OnGotId(int32 id);
+};
+
+[Peer=ViewManagerClient]
+interface ViewManager {
+ void CreateView();
+};
+
+[Peer=ViewManager]
+interface ViewManagerClient {
+ void OnViewCreated(handle<message_pipe> view);
+};
+
+}
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index eeff174..d2a82dc 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -54,6 +54,7 @@
'dependencies': [
'mojo_aura_demo',
'mojo_launcher',
+ 'mojo_view_manager',
],
}],
]
diff --git a/mojo/mojo_examples.gypi b/mojo/mojo_examples.gypi
index ee7459a..fcf4f63 100644
--- a/mojo/mojo_examples.gypi
+++ b/mojo/mojo_examples.gypi
@@ -117,6 +117,18 @@
'includes': [ 'build/package_app.gypi' ],
},
{
+ 'target_name': 'mojo_launcher_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'examples/launcher/launcher.mojom',
+ ],
+ 'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ 'mojo_bindings',
+ 'mojo_system',
+ ],
+ },
+ {
'target_name': 'mojo_launcher',
'type': 'shared_library',
'dependencies': [
@@ -143,6 +155,7 @@
'mojo_environment_chromium',
'mojo_gles2',
'mojo_gles2_bindings',
+ 'mojo_launcher_bindings',
'mojo_native_viewport_bindings',
'mojo_shell_bindings',
'mojo_system',
@@ -166,6 +179,43 @@
},
'includes': [ 'build/package_app.gypi' ],
},
+ {
+ 'target_name': 'mojo_view_manager_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'examples/view_manager/view_manager.mojom',
+ ],
+ 'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ 'mojo_bindings',
+ 'mojo_system',
+ ],
+ },
+ {
+ 'target_name': 'mojo_view_manager',
+ 'type': 'shared_library',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_common_lib',
+ 'mojo_environment_chromium',
+ 'mojo_launcher_bindings',
+ 'mojo_native_viewport_bindings',
+ 'mojo_shell_bindings',
+ 'mojo_system',
+ 'mojo_view_manager_bindings',
+ ],
+ 'sources': [
+ 'examples/view_manager/view_manager.cc',
+ ],
+ },
+ {
+ 'target_name': 'package_mojo_view_manager',
+ 'variables': {
+ 'app_name': 'mojo_view_manager',
+ },
+ 'includes': [ 'build/package_app.gypi' ],
+ },
],
}],
],
diff --git a/mojo/services/native_viewport/native_viewport.h b/mojo/services/native_viewport/native_viewport.h
index 483dc11..7ec5432 100644
--- a/mojo/services/native_viewport/native_viewport.h
+++ b/mojo/services/native_viewport/native_viewport.h
@@ -43,6 +43,7 @@ class NativeViewport {
virtual void Init(const gfx::Rect& bounds) = 0;
virtual void Show() = 0;
+ virtual void Hide() = 0;
virtual void Close() = 0;
virtual gfx::Size GetSize() = 0;
virtual void SetBounds(const gfx::Rect& bounds) = 0;
diff --git a/mojo/services/native_viewport/native_viewport.mojom b/mojo/services/native_viewport/native_viewport.mojom
index a5aae29..f9decc5 100644
--- a/mojo/services/native_viewport/native_viewport.mojom
+++ b/mojo/services/native_viewport/native_viewport.mojom
@@ -41,6 +41,7 @@ struct Event {
interface NativeViewport {
void Create(Rect bounds);
void Show();
+ void Hide();
void Close();
void SetBounds(Rect bounds);
void CreateGLES2Context(handle<message_pipe> gles2_client);
diff --git a/mojo/services/native_viewport/native_viewport_android.cc b/mojo/services/native_viewport/native_viewport_android.cc
index fce02d3..55b88c9 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -105,6 +105,10 @@ void NativeViewportAndroid::Show() {
// Nothing to do. View is created visible.
}
+void NativeViewportAndroid::Hide() {
+ // Nothing to do. View is always visible.
+}
+
void NativeViewportAndroid::Close() {
// TODO(beng): close activity containing MojoView?
diff --git a/mojo/services/native_viewport/native_viewport_android.h b/mojo/services/native_viewport/native_viewport_android.h
index ba34205..96ecd1f 100644
--- a/mojo/services/native_viewport/native_viewport_android.h
+++ b/mojo/services/native_viewport/native_viewport_android.h
@@ -44,6 +44,7 @@ class MOJO_NATIVE_VIEWPORT_EXPORT NativeViewportAndroid
// Overridden from NativeViewport:
virtual void Init(const gfx::Rect& bounds) OVERRIDE;
virtual void Show() OVERRIDE;
+ virtual void Hide() OVERRIDE;
virtual void Close() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
diff --git a/mojo/services/native_viewport/native_viewport_mac.mm b/mojo/services/native_viewport/native_viewport_mac.mm
index 83f1e72..9d7301f 100644
--- a/mojo/services/native_viewport/native_viewport_mac.mm
+++ b/mojo/services/native_viewport/native_viewport_mac.mm
@@ -45,6 +45,10 @@ class NativeViewportMac : public NativeViewport {
[window_ orderFront:nil];
}
+ virtual void Hide() OVERRIDE {
+ [window_ orderOut:nil];
+ }
+
virtual void Close() OVERRIDE {
// TODO(beng): perform this in response to NSWindow destruction.
delegate_->OnDestroyed();
diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc
index 97bc909..409a342 100644
--- a/mojo/services/native_viewport/native_viewport_service.cc
+++ b/mojo/services/native_viewport/native_viewport_service.cc
@@ -51,6 +51,10 @@ class NativeViewportService::NativeViewportImpl
native_viewport_->Show();
}
+ virtual void Hide() MOJO_OVERRIDE {
+ native_viewport_->Hide();
+ }
+
virtual void Close() MOJO_OVERRIDE {
gles2_.reset();
DCHECK(native_viewport_);
@@ -147,7 +151,7 @@ class NativeViewportService::NativeViewportImpl
virtual void OnBoundsChanged(const gfx::Rect& bounds) MOJO_OVERRIDE {
CreateGLES2ContextIfNeeded();
- AllocationScope allocation;
+ AllocationScope scope;
client_->OnBoundsChanged(bounds);
}
diff --git a/mojo/services/native_viewport/native_viewport_stub.cc b/mojo/services/native_viewport/native_viewport_stub.cc
index 421cec3..9dcb33a 100644
--- a/mojo/services/native_viewport/native_viewport_stub.cc
+++ b/mojo/services/native_viewport/native_viewport_stub.cc
@@ -23,6 +23,8 @@ class NativeViewportStub : public NativeViewport {
}
virtual void Show() OVERRIDE {
}
+ virtual void Hide() OVERRIDE {
+ }
virtual void Close() OVERRIDE {
delegate_->OnDestroyed();
}
diff --git a/mojo/services/native_viewport/native_viewport_win.cc b/mojo/services/native_viewport/native_viewport_win.cc
index 167ce45..948731f 100644
--- a/mojo/services/native_viewport/native_viewport_win.cc
+++ b/mojo/services/native_viewport/native_viewport_win.cc
@@ -39,7 +39,7 @@ class NativeViewportWin : public gfx::WindowImpl,
// Overridden from NativeViewport:
virtual void Init(const gfx::Rect& bounds) OVERRIDE {
gfx::Rect window_bounds = GetWindowBoundsForClientBounds(
- window_style(), window_ex_style(), bounds);
+ WS_OVERLAPPEDWINDOW, window_ex_style(), bounds);
gfx::WindowImpl::Init(NULL, window_bounds);
SetWindowText(hwnd(), L"native_viewport::NativeViewportWin!");
}
@@ -48,6 +48,10 @@ class NativeViewportWin : public gfx::WindowImpl,
ShowWindow(hwnd(), SW_SHOWNORMAL);
}
+ virtual void Hide() OVERRIDE {
+ ShowWindow(hwnd(), SW_HIDE);
+ }
+
virtual void Close() OVERRIDE {
DestroyWindow(hwnd());
}
diff --git a/mojo/services/native_viewport/native_viewport_x11.cc b/mojo/services/native_viewport/native_viewport_x11.cc
index 7b7e808..9c72876 100644
--- a/mojo/services/native_viewport/native_viewport_x11.cc
+++ b/mojo/services/native_viewport/native_viewport_x11.cc
@@ -59,6 +59,10 @@ class NativeViewportX11 : public NativeViewport,
XFlush(display);
}
+ virtual void Hide() OVERRIDE {
+ XWithdrawWindow(gfx::GetXDisplay(), window_, 0);
+ }
+
virtual void Close() OVERRIDE {
// TODO(beng): perform this in response to XWindow destruction.
delegate_->OnDestroyed();