| Index: chrome/browser/ui/cocoa/tab_dialogs_views_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/tab_dialogs_views_mac.mm b/chrome/browser/ui/cocoa/tab_dialogs_views_mac.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a784413e48fe93ae1bc5ba26167a6049bcf31eca
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/cocoa/tab_dialogs_views_mac.mm
|
| @@ -0,0 +1,48 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/ui/views/tab_dialogs_views.h"
|
| +
|
| +#import <Cocoa/Cocoa.h>
|
| +
|
| +#include "chrome/browser/ui/cocoa/tab_dialogs_cocoa.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +
|
| +namespace {
|
| +
|
| +// Implementation of TabDialogs interface for toolkit-views dialogs on Mac.
|
| +class TabDialogsViewsMac : public TabDialogsViews {
|
| + public:
|
| + explicit TabDialogsViewsMac(content::WebContents* contents);
|
| + ~TabDialogsViewsMac() override {}
|
| +
|
| + // TabDialogs:
|
| + gfx::NativeView GetDialogParentView() const override;
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(TabDialogsViewsMac);
|
| +};
|
| +
|
| +TabDialogsViewsMac::TabDialogsViewsMac(content::WebContents* contents)
|
| + : TabDialogsViews(contents) {}
|
| +
|
| +// The browser is still Cocoa, so this matches TabDialogsCocoa.
|
| +gfx::NativeView TabDialogsViewsMac::GetDialogParentView() const {
|
| + // View hierarchy of the contents view:
|
| + // NSView -- switchView, same for all tabs
|
| + // +- TabContentsContainerView -- TabContentsController's view
|
| + // +- WebContentsViewCocoa
|
| + //
|
| + // Changing it? Do not forget to modify
|
| + // -[TabStripController swapInTabAtIndex:] too.
|
| + return [web_contents()->GetNativeView() superview];
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +TabDialogs* TabDialogsCocoa::CreateTabDialogsViewsMac(
|
| + content::WebContents* contents) {
|
| + return new TabDialogsViewsMac(contents);
|
| +}
|
|
|