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

Side by Side Diff: apps/ui/native_app_window.h

Issue 27207003: Fix declaration vs. implementation ordering in NativeAppWindow{Views|Gtk} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move native_app_window.h to ui Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef APPS_NATIVE_APP_WINDOW_H_ 5 #ifndef APPS_UI_NATIVE_APP_WINDOW_H_
6 #define APPS_NATIVE_APP_WINDOW_H_ 6 #define APPS_UI_NATIVE_APP_WINDOW_H_
7 7
8 #include "apps/shell_window.h" 8 #include "apps/shell_window.h"
9 #include "components/web_modal/web_contents_modal_dialog_host.h" 9 #include "components/web_modal/web_contents_modal_dialog_host.h"
10 #include "ui/base/base_window.h" 10 #include "ui/base/base_window.h"
11 #include "ui/gfx/insets.h" 11 #include "ui/gfx/insets.h"
12 12
13 namespace apps { 13 namespace apps {
14 14
15 // This is an interface to a native implementation of a shell window, used for 15 // This is an interface to a native implementation of a shell window, used for
16 // new-style packaged apps. Shell windows contain a web contents, but no tabs 16 // new-style packaged apps. Shell windows contain a web contents, but no tabs
17 // or URL bar. 17 // or URL bar.
18 class NativeAppWindow : public ui::BaseWindow, 18 class NativeAppWindow : public ui::BaseWindow,
19 public web_modal::WebContentsModalDialogHost { 19 public web_modal::WebContentsModalDialogHost {
20 public: 20 public:
21 // Called when the draggable regions are changed. 21 // Fullscreen changes may be asynchronous on some platforms.
22 virtual void UpdateDraggableRegions(
23 const std::vector<extensions::DraggableRegion>& regions) = 0;
24
25 // Returns the region used by frameless windows for dragging. May return NULL.
26 virtual SkRegion* GetDraggableRegion() = 0;
27
28 // Called when the region that accepts input events is changed.
29 // If |region| is NULL, then the entire window will accept input events.
30 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) = 0;
31
32 virtual void SetFullscreen(bool fullscreen) = 0; 22 virtual void SetFullscreen(bool fullscreen) = 0;
33 virtual bool IsFullscreenOrPending() const = 0; 23 virtual bool IsFullscreenOrPending() const = 0;
34 24
35 // Returns true if the window is a panel that has been detached. 25 // Returns true if the window is a panel that has been detached.
36 virtual bool IsDetached() const = 0; 26 virtual bool IsDetached() const = 0;
37 27
38 // Called when the icon of the window changes. 28 // Called when the icon of the window changes.
39 virtual void UpdateWindowIcon() = 0; 29 virtual void UpdateWindowIcon() = 0;
40 30
41 // Called when the title of the window changes. 31 // Called when the title of the window changes.
42 virtual void UpdateWindowTitle() = 0; 32 virtual void UpdateWindowTitle() = 0;
43 33
34 // Called when the draggable regions are changed.
35 virtual void UpdateDraggableRegions(
36 const std::vector<extensions::DraggableRegion>& regions) = 0;
37
38 // Returns the region used by frameless windows for dragging. May return NULL.
39 virtual SkRegion* GetDraggableRegion() = 0;
40
41 // Called when the region that accepts input events is changed.
42 // If |region| is NULL, then the entire window will accept input events.
43 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) = 0;
44
44 // Allows the window to handle unhandled keyboard messages coming back from 45 // Allows the window to handle unhandled keyboard messages coming back from
45 // the renderer. 46 // the renderer.
46 virtual void HandleKeyboardEvent( 47 virtual void HandleKeyboardEvent(
47 const content::NativeWebKeyboardEvent& event) = 0; 48 const content::NativeWebKeyboardEvent& event) = 0;
48 49
49 // Returns true if the window has no frame, as for a window opened by 50 // Returns true if the window has no frame, as for a window opened by
50 // chrome.app.window.create with the option 'frame' set to 'none'. 51 // chrome.app.window.create with the option 'frame' set to 'none'.
51 virtual bool IsFrameless() const = 0; 52 virtual bool IsFrameless() const = 0;
52 53
53 // Returns the difference between the window bounds (including titlebar and 54 // Returns the difference between the window bounds (including titlebar and
54 // borders) and the content bounds, if any. 55 // borders) and the content bounds, if any.
55 virtual gfx::Insets GetFrameInsets() const = 0; 56 virtual gfx::Insets GetFrameInsets() const = 0;
56 57
57 // Indicate whether or not the window is visible. 58 // Indicate whether or not the window is visible.
58 virtual bool IsVisible() const = 0; 59 virtual bool IsVisible() const = 0;
59 60
60 // Hide or show this window as part of hiding or showing the app. 61 // Hide or show this window as part of hiding or showing the app.
61 // This may have different logic to Hide, Show, and ShowInactive as those are 62 // This may have different logic to Hide, Show, and ShowInactive as those are
62 // called via the AppWindow javascript API. 63 // called via the AppWindow javascript API.
63 virtual void ShowWithApp() = 0; 64 virtual void ShowWithApp() = 0;
64 virtual void HideWithApp() = 0; 65 virtual void HideWithApp() = 0;
65 66
66 virtual ~NativeAppWindow() {} 67 virtual ~NativeAppWindow() {}
67 }; 68 };
68 69
69 } // namespace apps 70 } // namespace apps
70 71
71 #endif // APPS_NATIVE_APP_WINDOW_H_ 72 #endif // APPS_UI_NATIVE_APP_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698