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 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ | |
5 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ | |
6 | |
7 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" | |
8 | |
9 class GURL; | |
10 class Profile; | |
11 | |
12 namespace content { | |
13 class WebContents; | |
14 } | |
15 | |
16 // Context in which exclusive access operation is being performed. This | |
17 // interface is implemented once in Browser context and in Platform Application | |
18 // context. | |
19 class ExclusiveAccessContext { | |
scheib
2015/02/10 23:12:03
I think I'm preferring the Delegate pattern where
Sriram
2015/02/10 23:44:46
Yuri had same suggestion. It would be BrowserWindo
| |
20 public: | |
21 virtual ~ExclusiveAccessContext() {} | |
22 | |
23 // Returns the current profile associated with the window. | |
24 virtual Profile* GetProfile() = 0; | |
scheib
2015/02/10 23:12:03
Profile* won't work in extensions, it will need to
Sriram
2015/02/10 23:44:46
I thought I could go from BrowserContext to Profil
scheib
2015/02/11 00:05:55
Ah, yes, so long as the code accessing is in chrom
Sriram
2015/02/25 00:41:23
Acknowledged.
| |
25 | |
26 // Returns true if the window hosting the exclusive access bubble is | |
27 // fullscreen. | |
28 virtual bool IsFullscreen() = 0; | |
scheib
2015/02/10 23:12:03
Most of these methods so far are Fullscreen relate
Sriram
2015/02/10 23:44:46
I was planning to use ExclusiveAccessController as
| |
29 | |
30 // Returns true if the window host the exclusive access bubble is fullscreen. | |
31 virtual bool IsFullscreenWithToolbar() = 0; | |
32 | |
33 // Returns true if fullscreen with toolbar is supported. | |
34 virtual bool SupportsFullscreenWithToolbar() = 0; | |
35 | |
36 // Methods that change fullscreen state. | |
37 // On Mac, the tab strip and toolbar will be shown if |with_toolbar| is true, | |
38 // |with_toolbar| is ignored on other platforms. | |
39 virtual void EnterFullscreen(const GURL& url, | |
40 ExclusiveAccessBubbleType bubble_type, | |
41 bool with_toolbar) = 0; | |
42 virtual void ExitFullscreen() = 0; | |
43 // Updates the content of exclusive access exit bubble content. | |
44 virtual void UpdateExclusiveAccessExitBubbleContent( | |
45 GURL url, | |
46 ExclusiveAccessBubbleType bubble_type) = 0; | |
47 | |
48 // Returns the currently active WebContents, or nullptr if there is none. | |
49 virtual content::WebContents* GetActiveWebContents() = 0; | |
50 | |
51 // Shows or hides the tab strip, toolbar and bookmark bar with in browser | |
52 // fullscreen. | |
53 // Currently only supported on Mac. | |
54 virtual void UpdateFullscreenWithToolbar(bool with_toolbar) = 0; | |
55 | |
56 // Sets state for entering or exiting Win8 Metro snap mode. | |
57 virtual void SetMetroSnapMode(bool enable) = 0; | |
58 | |
59 // Returns whether the window is currently in Win8 Metro snap mode. | |
60 virtual bool IsInMetroSnapMode() = 0; | |
61 | |
62 // Shows or hides download shelf associated with currently active window. | |
63 virtual void UpdateDownloadShelf(bool unhide) = 0; | |
64 }; | |
65 | |
66 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_CONTEXT_H_ | |
OLD | NEW |