| Index: chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm
|
| diff --git a/chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm b/chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm
|
| index 65b44a8ac286e865c0fac1495e23a8e867b98e51..7026b3208fcedbcb1c92c71fe9b6770950536038 100644
|
| --- a/chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm
|
| +++ b/chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm
|
| @@ -7,9 +7,13 @@
|
| #include "chrome/browser/download/download_shelf.h"
|
| #include "chrome/browser/fullscreen.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| +#include "chrome/browser/ui/cocoa/accelerators_cocoa.h"
|
| #import "chrome/browser/ui/cocoa/browser_window_controller.h"
|
| #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h"
|
| +#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
|
| #include "chrome/browser/ui/status_bubble.h"
|
| +#include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
|
| +#import "ui/gfx/mac/coordinate_conversion.h"
|
|
|
| ExclusiveAccessController::ExclusiveAccessController(
|
| BrowserWindowController* controller,
|
| @@ -21,6 +25,12 @@ ExclusiveAccessController::ExclusiveAccessController(
|
| ExclusiveAccessController::~ExclusiveAccessController() {}
|
|
|
| void ExclusiveAccessController::Show() {
|
| + if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
|
| + views_bubble_.reset(
|
| + new ExclusiveAccessBubbleViews(this, url_, bubble_type_));
|
| + return;
|
| + }
|
| +
|
| [cocoa_bubble_ closeImmediately];
|
| cocoa_bubble_.reset([[ExclusiveAccessBubbleWindowController alloc]
|
| initWithOwner:controller_
|
| @@ -32,6 +42,7 @@ void ExclusiveAccessController::Show() {
|
| }
|
|
|
| void ExclusiveAccessController::Destroy() {
|
| + views_bubble_.reset();
|
| [cocoa_bubble_ closeImmediately];
|
| cocoa_bubble_.reset();
|
| url_ = GURL();
|
| @@ -39,6 +50,8 @@ void ExclusiveAccessController::Destroy() {
|
| }
|
|
|
| void ExclusiveAccessController::Layout(CGFloat max_y) {
|
| + if (views_bubble_)
|
| + views_bubble_->RepositionIfVisible();
|
| [cocoa_bubble_ positionInWindowAtTop:max_y];
|
| }
|
|
|
| @@ -98,7 +111,8 @@ void ExclusiveAccessController::UpdateExclusiveAccessExitBubbleContent(
|
| }
|
|
|
| void ExclusiveAccessController::OnExclusiveAccessUserInput() {
|
| - // TODO(mgiuca): Route this signal to the exclusive access bubble on Mac.
|
| + if (views_bubble_)
|
| + views_bubble_->OnUserInput();
|
| }
|
|
|
| content::WebContents* ExclusiveAccessController::GetActiveWebContents() {
|
| @@ -116,6 +130,51 @@ void ExclusiveAccessController::HideDownloadShelf() {
|
| statusBubble->Hide();
|
| }
|
|
|
| +bool ExclusiveAccessController::GetAcceleratorForCommandId(
|
| + int cmd_id,
|
| + ui::Accelerator* accelerator) {
|
| + *accelerator =
|
| + *AcceleratorsCocoa::GetInstance()->GetAcceleratorForCommand(cmd_id);
|
| + return true;
|
| +}
|
| +
|
| +ExclusiveAccessManager* ExclusiveAccessController::GetExclusiveAccessManager() {
|
| + return browser_->exclusive_access_manager();
|
| +}
|
| +
|
| +views::Widget* ExclusiveAccessController::GetBubbleAssociatedWidget() {
|
| + NOTREACHED(); // Only used for non-simplified UI.
|
| + return nullptr;
|
| +}
|
| +
|
| +ui::AcceleratorProvider* ExclusiveAccessController::GetAcceleratorProvider() {
|
| + return this;
|
| +}
|
| +
|
| +gfx::NativeView ExclusiveAccessController::GetBubbleParentView() const {
|
| + return [[controller_ window] contentView];
|
| +}
|
| +
|
| +gfx::Point ExclusiveAccessController::GetCursorPointInParent() const {
|
| + NSWindow* window = [controller_ window];
|
| + NSPoint location = [window convertScreenToBase:[NSEvent mouseLocation]];
|
| + return gfx::Point(location.x,
|
| + NSHeight([[window contentView] frame]) - location.y);
|
| +}
|
| +
|
| +gfx::Rect ExclusiveAccessController::GetClientAreaBoundsInScreen() const {
|
| + return gfx::ScreenRectFromNSRect([[controller_ window] frame]);
|
| +}
|
| +
|
| +bool ExclusiveAccessController::IsImmersiveModeEnabled() {
|
| + return false;
|
| +}
|
| +
|
| +gfx::Rect ExclusiveAccessController::GetTopContainerBoundsInScreen() {
|
| + NOTREACHED(); // Only used for ImmersiveMode.
|
| + return gfx::Rect();
|
| +}
|
| +
|
| BrowserWindow* ExclusiveAccessController::GetBrowserWindow() const {
|
| return [controller_ browserWindow];
|
| }
|
|
|