summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 17:40:26 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 17:40:26 +0000
commitffec0fcb7a28608f829646e62d6a21ad69860016 (patch)
treec752d7ff26462684dfbbfd11560b7b23d402d977 /apps
parent7603bbd17fc813ce41d8105a21df066f70ef0789 (diff)
downloadchromium_src-ffec0fcb7a28608f829646e62d6a21ad69860016.zip
chromium_src-ffec0fcb7a28608f829646e62d6a21ad69860016.tar.gz
chromium_src-ffec0fcb7a28608f829646e62d6a21ad69860016.tar.bz2
Add support for setInputRegion API.
The setInputRegion API allows windows to define a region that accepts user input. If the input region is not specified, it defaults to the entire window, otherwise only events within the specified region will be processed by the window. Events outside this region will be passed to the window below. This API is supported on CrOS only and requires Dev channel. BUG=272326 R=benwells@chromium.org, kalman@chromium.org, pkasting@chromium.org, sadrul@chromium.org, stevenjb@chromium.org, wez@chromium.org Review URL: https://codereview.chromium.org/21123006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r--apps/native_app_window.h4
-rw-r--r--apps/shell_window.cc4
-rw-r--r--apps/shell_window.h4
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/native_app_window.h b/apps/native_app_window.h
index 0286453..fcad3ce 100644
--- a/apps/native_app_window.h
+++ b/apps/native_app_window.h
@@ -22,6 +22,10 @@ class NativeAppWindow : public ui::BaseWindow,
virtual void UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions) = 0;
+ // Called when the region that accepts input events is changed.
+ // If |region| is NULL, then the entire window will accept input events.
+ virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) = 0;
+
virtual void SetFullscreen(bool fullscreen) = 0;
virtual bool IsFullscreenOrPending() const = 0;
diff --git a/apps/shell_window.cc b/apps/shell_window.cc
index 10ab851..23d63f8 100644
--- a/apps/shell_window.cc
+++ b/apps/shell_window.cc
@@ -364,6 +364,10 @@ void ShellWindow::SetAppIconUrl(const GURL& url) {
image_loader_ptr_factory_.GetWeakPtr()));
}
+void ShellWindow::UpdateInputRegion(scoped_ptr<SkRegion> region) {
+ native_app_window_->UpdateInputRegion(region.Pass());
+}
+
void ShellWindow::UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions) {
native_app_window_->UpdateDraggableRegions(regions);
diff --git a/apps/shell_window.h b/apps/shell_window.h
index 6bf4ebf..53dd2b3 100644
--- a/apps/shell_window.h
+++ b/apps/shell_window.h
@@ -228,6 +228,10 @@ class ShellWindow : public content::NotificationObserver,
// Specifies a url for the launcher icon.
void SetAppIconUrl(const GURL& icon_url);
+ // Set the region in the window that will accept input events.
+ // If |region| is NULL, then the entire window will accept input events.
+ void UpdateInputRegion(scoped_ptr<SkRegion> region);
+
// Called from the render interface to modify the draggable regions.
void UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions);