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

Side by Side Diff: chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h

Issue 1650483002: Refactor: Untangle Mac's ExclusiveAccessContext from BrowserWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self nits, More robust interface, fix other random stuff Created 4 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2016 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_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
7
8 // Note this file has a _views suffix so that it may have an optional runtime
9 // dependency on toolkit-views UI.
10
11 #import <CoreGraphics/CoreGraphics.h>
12
13 #import "base/mac/scoped_nsobject.h"
14 #include "base/macros.h"
15 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
16
17 class Browser;
18 class BrowserWindow;
19 @class BrowserWindowController;
20 @class ExclusiveAccessBubbleWindowController;
21 class GURL;
22
23 // Component placed into a browser window controller to manage communication
24 // with the exclusive access bubble, which appears when entering fullscreen.
25 class ExclusiveAccessController : public ExclusiveAccessContext {
26 public:
27 ExclusiveAccessController(BrowserWindowController* controller,
28 Browser* browser);
29 ~ExclusiveAccessController() override;
30
31 const GURL& url() const { return url_; }
32 ExclusiveAccessBubbleType bubble_type() const { return bubble_type_; }
33 ExclusiveAccessBubbleWindowController* cocoa_bubble() {
34 return cocoa_bubble_;
35 }
36
37 // Shows the bubble once the NSWindow has received -windowDidEnterFullScreen:.
38 void Show();
39
40 // Closes any open bubble.
41 void Destroy();
42
43 // If showing, position the bubble at the given y-coordinate.
44 void Layout(CGFloat max_y);
45
46 // ExclusiveAccessContext:
47 Profile* GetProfile() override;
48 bool IsFullscreen() const override;
spqchan 2016/02/01 19:55:04 Can you also move the comments that describe these
tapted 2016/02/02 11:57:06 There weren't any on BrowserWindowController - I t
49 bool SupportsFullscreenWithToolbar() const override;
50 void UpdateFullscreenWithToolbar(bool with_toolbar) override;
51 void ToggleFullscreenToolbar() override;
52 bool IsFullscreenWithToolbar() const override;
53 void EnterFullscreen(const GURL& url,
54 ExclusiveAccessBubbleType type,
55 bool with_toolbar) override;
56 void ExitFullscreen() override;
57 void UpdateExclusiveAccessExitBubbleContent(
58 const GURL& url,
59 ExclusiveAccessBubbleType bubble_type) override;
60 void OnExclusiveAccessUserInput() override;
61 content::WebContents* GetActiveWebContents() override;
62 void UnhideDownloadShelf() override;
63 void HideDownloadShelf() override;
64
65 private:
66 BrowserWindow* GetBrowserWindow() const;
67
68 BrowserWindowController* controller_; // Weak. Owns |this|.
69 Browser* browser_; // Weak. Owned by controller.
70
71 // When going fullscreen for a tab, we need to store the URL and the
72 // fullscreen type, since we can't show the bubble until
73 // -windowDidEnterFullScreen: gets called.
74 GURL url_;
75 ExclusiveAccessBubbleType bubble_type_;
76
77 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> cocoa_bubble_;
78
79 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessController);
80 };
81
82 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698