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

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

Issue 1654723002: Enable showing the toolkit-views simplified fullscreen UI on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150112-MacViews-NewFullscreenBubble
Patch Set: Update section comments 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_ 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
7 7
8 // Note this file has a _views suffix so that it may have an optional runtime 8 // Note this file has a _views suffix so that it may have an optional runtime
9 // dependency on toolkit-views UI. 9 // dependency on toolkit-views UI.
10 10
11 #import <CoreGraphics/CoreGraphics.h> 11 #import <CoreGraphics/CoreGraphics.h>
12 12
13 #import "base/mac/scoped_nsobject.h" 13 #import "base/mac/scoped_nsobject.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h"
15 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" 16 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
17 #include "chrome/browser/ui/views/exclusive_access_bubble_views_context.h"
18 #include "ui/base/accelerators/accelerator.h"
16 19
17 class Browser; 20 class Browser;
18 class BrowserWindow; 21 class BrowserWindow;
19 @class BrowserWindowController; 22 @class BrowserWindowController;
23 class ExclusiveAccessBubbleViews;
20 @class ExclusiveAccessBubbleWindowController; 24 @class ExclusiveAccessBubbleWindowController;
21 class GURL; 25 class GURL;
22 26
23 // Component placed into a browser window controller to manage communication 27 // Component placed into a browser window controller to manage communication
24 // with the exclusive access bubble, which appears for events such as entering 28 // with the exclusive access bubble, which appears for events such as entering
25 // fullscreen. 29 // fullscreen.
26 class ExclusiveAccessController : public ExclusiveAccessContext { 30 class ExclusiveAccessController : public ExclusiveAccessContext,
31 public ui::AcceleratorProvider,
32 public ExclusiveAccessBubbleViewsContext {
27 public: 33 public:
28 ExclusiveAccessController(BrowserWindowController* controller, 34 ExclusiveAccessController(BrowserWindowController* controller,
29 Browser* browser); 35 Browser* browser);
30 ~ExclusiveAccessController() override; 36 ~ExclusiveAccessController() override;
31 37
32 const GURL& url() const { return url_; } 38 const GURL& url() const { return url_; }
33 ExclusiveAccessBubbleType bubble_type() const { return bubble_type_; } 39 ExclusiveAccessBubbleType bubble_type() const { return bubble_type_; }
34 ExclusiveAccessBubbleWindowController* cocoa_bubble() { 40 ExclusiveAccessBubbleWindowController* cocoa_bubble() {
35 return cocoa_bubble_; 41 return cocoa_bubble_;
36 } 42 }
(...skipping 19 matching lines...) Expand all
56 bool with_toolbar) override; 62 bool with_toolbar) override;
57 void ExitFullscreen() override; 63 void ExitFullscreen() override;
58 void UpdateExclusiveAccessExitBubbleContent( 64 void UpdateExclusiveAccessExitBubbleContent(
59 const GURL& url, 65 const GURL& url,
60 ExclusiveAccessBubbleType bubble_type) override; 66 ExclusiveAccessBubbleType bubble_type) override;
61 void OnExclusiveAccessUserInput() override; 67 void OnExclusiveAccessUserInput() override;
62 content::WebContents* GetActiveWebContents() override; 68 content::WebContents* GetActiveWebContents() override;
63 void UnhideDownloadShelf() override; 69 void UnhideDownloadShelf() override;
64 void HideDownloadShelf() override; 70 void HideDownloadShelf() override;
65 71
72 // ui::AcceleratorProvider:
73 bool GetAcceleratorForCommandId(int command_id,
74 ui::Accelerator* accelerator) override;
75
76 // ExclusiveAccessBubbleViewsContext:
77 ExclusiveAccessManager* GetExclusiveAccessManager() override;
78 views::Widget* GetBubbleAssociatedWidget() override;
79 ui::AcceleratorProvider* GetAcceleratorProvider() override;
80 gfx::NativeView GetBubbleParentView() const override;
81 gfx::Point GetCursorPointInParent() const override;
82 gfx::Rect GetClientAreaBoundsInScreen() const override;
83 bool IsImmersiveModeEnabled() override;
84 gfx::Rect GetTopContainerBoundsInScreen() override;
85
66 private: 86 private:
67 BrowserWindow* GetBrowserWindow() const; 87 BrowserWindow* GetBrowserWindow() const;
68 88
69 BrowserWindowController* controller_; // Weak. Owns |this|. 89 BrowserWindowController* controller_; // Weak. Owns |this|.
70 Browser* browser_; // Weak. Owned by controller. 90 Browser* browser_; // Weak. Owned by controller.
71 91
72 // When going fullscreen for a tab, we need to store the URL and the 92 // When going fullscreen for a tab, we need to store the URL and the
73 // fullscreen type, since we can't show the bubble until 93 // fullscreen type, since we can't show the bubble until
74 // -windowDidEnterFullScreen: gets called. 94 // -windowDidEnterFullScreen: gets called.
75 GURL url_; 95 GURL url_;
76 ExclusiveAccessBubbleType bubble_type_; 96 ExclusiveAccessBubbleType bubble_type_;
77 97
98 scoped_ptr<ExclusiveAccessBubbleViews> views_bubble_;
78 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> cocoa_bubble_; 99 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> cocoa_bubble_;
79 100
80 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessController); 101 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessController);
81 }; 102 };
82 103
83 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_ 104 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_EXCLUSIVE_ACCESS_CONTROLLER_VIEWS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698