Add ability to gather metrics to BubbleManager.
[chromium-blink-merge.git] / chrome / browser / ui / exclusive_access / exclusive_access_context.h
blob36fc41baff6d2fda9dc71544abd942d7d2551202
1 // Copyright (c) 2015 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 CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_
6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_
8 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h"
10 class GURL;
11 class Profile;
13 namespace content {
14 class WebContents;
17 // Context in which exclusive access operation is being performed. This
18 // interface is implemented once in Browser context and in Platform Application
19 // context.
20 class ExclusiveAccessContext {
21 public:
22 virtual ~ExclusiveAccessContext() {}
24 // Returns the current profile associated with the window.
25 virtual Profile* GetProfile() = 0;
27 // Returns true if the window hosting the exclusive access bubble is
28 // fullscreen.
29 virtual bool IsFullscreen() const = 0;
31 // Returns true if fullscreen with toolbar is supported.
32 virtual bool SupportsFullscreenWithToolbar() const;
34 // Shows or hides the tab strip, toolbar and bookmark bar with in browser
35 // fullscreen.
36 // Currently only supported on Mac.
37 virtual void UpdateFullscreenWithToolbar(bool with_toolbar);
39 // Returns true if the window is fullscreen with additional UI elements. See
40 // EnterFullscreen |with_toolbar|.
41 virtual bool IsFullscreenWithToolbar() const = 0;
43 // Enters fullscreen and update exit bubble.
44 // On Mac, the tab strip and toolbar will be shown if |with_toolbar| is true,
45 // |with_toolbar| is ignored on other platforms.
46 virtual void EnterFullscreen(const GURL& url,
47 ExclusiveAccessBubbleType bubble_type,
48 bool with_toolbar) = 0;
50 // Exits fullscreen and update exit bubble.
51 virtual void ExitFullscreen() = 0;
53 // Updates the content of exclusive access exit bubble content.
54 virtual void UpdateExclusiveAccessExitBubbleContent(
55 const GURL& url,
56 ExclusiveAccessBubbleType bubble_type) = 0;
58 #if defined(OS_WIN)
59 // Sets state for entering or exiting Win8 Metro snap mode.
60 virtual void SetMetroSnapMode(bool enable);
62 // Returns whether the window is currently in Win8 Metro snap mode.
63 virtual bool IsInMetroSnapMode() const;
64 #endif // defined(OS_WIN)
66 // Returns the currently active WebContents, or nullptr if there is none.
67 virtual content::WebContents* GetActiveWebContents() = 0;
69 // TODO(sriramsr): This is abstraction violation as the following two function
70 // does not apply to a platform app window. Ideally, the BrowserView should
71 // hide/unhide its download shelf widget when it is instructed to enter/exit
72 // fullscreen mode.
73 // Displays the download shelf associated with currently active window.
74 virtual void UnhideDownloadShelf();
76 // Hides download shelf associated with currently active window.
77 virtual void HideDownloadShelf();
80 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_