Add an extension override bubble and warning box for proxy extensions. (2nd attempt...
[chromium-blink-merge.git] / apps / ui / native_app_window.h
blobcde4c1dfad8102de7ce4b484e60c1fcc30e9e5b5
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
3 // found in the LICENSE file.
5 #ifndef APPS_UI_NATIVE_APP_WINDOW_H_
6 #define APPS_UI_NATIVE_APP_WINDOW_H_
8 #include "apps/app_window.h"
9 #include "components/web_modal/web_contents_modal_dialog_host.h"
10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/base/base_window.h"
12 #include "ui/gfx/insets.h"
14 namespace apps {
16 // This is an interface to a native implementation of a app window, used for
17 // new-style packaged apps. App windows contain a web contents, but no tabs
18 // or URL bar.
19 class NativeAppWindow : public ui::BaseWindow,
20 public web_modal::WebContentsModalDialogHost {
21 public:
22 // Sets whether the window is fullscreen and the type of fullscreen.
23 // |fullscreen_types| is a bit field of AppWindow::FullscreenType.
24 virtual void SetFullscreen(int fullscreen_types) = 0;
26 // Returns whether the window is fullscreen or about to enter fullscreen.
27 virtual bool IsFullscreenOrPending() const = 0;
29 // Returns true if the window is a panel that has been detached.
30 virtual bool IsDetached() const = 0;
32 // Called when the icon of the window changes.
33 virtual void UpdateWindowIcon() = 0;
35 // Called when the title of the window changes.
36 virtual void UpdateWindowTitle() = 0;
38 // Called to update the badge icon.
39 virtual void UpdateBadgeIcon() = 0;
41 // Called when the draggable regions are changed.
42 virtual void UpdateDraggableRegions(
43 const std::vector<extensions::DraggableRegion>& regions) = 0;
45 // Returns the region used by frameless windows for dragging. May return NULL.
46 virtual SkRegion* GetDraggableRegion() = 0;
48 // Called when the window shape is changed. If |region| is NULL then the
49 // window is restored to the default shape.
50 virtual void UpdateShape(scoped_ptr<SkRegion> region) = 0;
52 // Allows the window to handle unhandled keyboard messages coming back from
53 // the renderer.
54 virtual void HandleKeyboardEvent(
55 const content::NativeWebKeyboardEvent& event) = 0;
57 // Returns true if the window has no frame, as for a window opened by
58 // chrome.app.window.create with the option 'frame' set to 'none'.
59 virtual bool IsFrameless() const = 0;
61 // Returns information about the window's frame.
62 virtual bool HasFrameColor() const = 0;
63 virtual SkColor ActiveFrameColor() const = 0;
64 virtual SkColor InactiveFrameColor() const = 0;
66 // Returns the difference between the window bounds (including titlebar and
67 // borders) and the content bounds, if any.
68 virtual gfx::Insets GetFrameInsets() const = 0;
70 // Hide or show this window as part of hiding or showing the app.
71 // This may have different logic to Hide, Show, and ShowInactive as those are
72 // called via the AppWindow javascript API.
73 virtual void ShowWithApp() = 0;
74 virtual void HideWithApp() = 0;
76 // Updates custom entries for the context menu of the app's taskbar/dock/shelf
77 // icon.
78 virtual void UpdateShelfMenu() = 0;
80 // Returns the minimum size constraints of the content.
81 virtual gfx::Size GetContentMinimumSize() const = 0;
83 // Returns the maximum size constraints of the content.
84 virtual gfx::Size GetContentMaximumSize() const = 0;
86 // Updates the minimum and maximum size constraints of the content.
87 virtual void SetContentSizeConstraints(const gfx::Size& min_size,
88 const gfx::Size& max_size) = 0;
90 virtual ~NativeAppWindow() {}
93 } // namespace apps
95 #endif // APPS_UI_NATIVE_APP_WINDOW_H_