OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ |
| 7 |
| 8 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" |
| 9 |
| 10 class GURL; |
| 11 class Profile; |
| 12 |
| 13 namespace content { |
| 14 class WebContents; |
| 15 } |
| 16 |
| 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() {} |
| 23 |
| 24 // Returns the current profile associated with the window. |
| 25 virtual Profile* GetProfile() = 0; |
| 26 |
| 27 // Returns true if the window hosting the exclusive access bubble is |
| 28 // fullscreen. |
| 29 virtual bool IsFullscreen() const = 0; |
| 30 |
| 31 // Returns true if fullscreen with toolbar is supported. |
| 32 virtual bool SupportsFullscreenWithToolbar() const; |
| 33 |
| 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); |
| 38 |
| 39 // Returns true if the window is fullscreen with additional UI elements. See |
| 40 // EnterFullscreen |with_toolbar|. |
| 41 virtual bool IsFullscreenWithToolbar() const = 0; |
| 42 |
| 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; |
| 49 |
| 50 // Exits fullscreen and update exit bubble. |
| 51 virtual void ExitFullscreen() = 0; |
| 52 |
| 53 // Updates the content of exclusive access exit bubble content. |
| 54 virtual void UpdateExclusiveAccessExitBubbleContent( |
| 55 const GURL& url, |
| 56 ExclusiveAccessBubbleType bubble_type) = 0; |
| 57 |
| 58 #if defined(OS_WIN) |
| 59 // Sets state for entering or exiting Win8 Metro snap mode. |
| 60 virtual void SetMetroSnapMode(bool enable); |
| 61 |
| 62 // Returns whether the window is currently in Win8 Metro snap mode. |
| 63 virtual bool IsInMetroSnapMode() const; |
| 64 #endif // defined(OS_WIN) |
| 65 |
| 66 // Returns the currently active WebContents, or nullptr if there is none. |
| 67 virtual content::WebContents* GetActiveWebContents() = 0; |
| 68 |
| 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(); |
| 75 |
| 76 // Hides download shelf associated with currently active window. |
| 77 virtual void HideDownloadShelf(); |
| 78 }; |
| 79 |
| 80 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ |
OLD | NEW |