Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1031)

Unified Diff: chrome/browser/ui/extensions/native_shell_window.h

Issue 11028125: Remove legacy draggable region code and refactor to share common draggable region code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/native_shell_window.h
diff --git a/chrome/browser/ui/extensions/native_shell_window.h b/chrome/browser/ui/extensions/native_shell_window.h
index 96db04ddd855c657c68c9cf8788944979258f137..603a39d84708ed8375d53c8bf7664714998471cb 100644
--- a/chrome/browser/ui/extensions/native_shell_window.h
+++ b/chrome/browser/ui/extensions/native_shell_window.h
@@ -5,8 +5,10 @@
#ifndef CHROME_BROWSER_UI_EXTENSIONS_NATIVE_SHELL_WINDOW_H_
#define CHROME_BROWSER_UI_EXTENSIONS_NATIVE_SHELL_WINDOW_H_
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/base_window.h"
+#include "third_party/skia/include/core/SkRegion.h"
// This is an interface to a native implementation of a shell window, used for
// new-style packaged apps. Shell windows contain a web contents, but no tabs
@@ -14,18 +16,12 @@
class NativeShellWindow : public BaseWindow {
public:
// Used by ShellWindow to instantiate the platform-specific ShellWindow code.
- static NativeShellWindow* Create(ShellWindow* window,
+ static NativeShellWindow* Create(ShellWindow* shell_window,
const ShellWindow::CreateParams& params);
// Called when the draggable regions are changed.
virtual void UpdateDraggableRegions(
- const std::vector<extensions::DraggableRegion>& regions) {}
-
- // Called when the draggable regions with the old syntax are changed.
- // TODO(jianli): to be removed after WebKit patch that changes the draggable
- // region syntax is landed.
- virtual void UpdateLegacyDraggableRegions(
- const std::vector<extensions::DraggableRegion>& regions) {}
+ const std::vector<extensions::DraggableRegion>& regions);
virtual void SetFullscreen(bool fullscreen) = 0;
virtual bool IsFullscreenOrPending() const = 0;
@@ -41,7 +37,20 @@ class NativeShellWindow : public BaseWindow {
virtual void HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) = 0;
- virtual ~NativeShellWindow() {}
+ virtual ~NativeShellWindow();
+
+ // Returns true if point (|x|, |y|) falls within the draggable regions.
+ bool IsInsideDraggableRegions(int x, int y) const;
+
+ bool frameless() const { return frameless_; }
+ SkRegion* draggable_regions() const { return draggable_regions_.get(); }
+
+ protected:
+ explicit NativeShellWindow(const ShellWindow::CreateParams& params);
+
+ private:
+ bool frameless_;
Ben Goodger (Google) 2012/10/12 16:24:41 since this is an interface, you can't have state l
jianli 2012/10/12 21:39:40 Changed to put the common draggable region convers
+ scoped_ptr<SkRegion> draggable_regions_;
};
#endif // CHROME_BROWSER_UI_EXTENSIONS_NATIVE_SHELL_WINDOW_H_
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm ('k') | chrome/browser/ui/extensions/native_shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698