Index: chrome/browser/ui/views/mac/web_contents_modal_dialog_manager_views_mac.h |
diff --git a/chrome/browser/ui/views/mac/web_contents_modal_dialog_manager_views_mac.h b/chrome/browser/ui/views/mac/web_contents_modal_dialog_manager_views_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c2fedc6b9bb298647dbe1cfb9ff6966116a81927 |
--- /dev/null |
+++ b/chrome/browser/ui/views/mac/web_contents_modal_dialog_manager_views_mac.h |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 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. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_MAC_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_MAC_H_ |
+ |
+#define CHROME_BROWSER_UI_VIEWS_MAC_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_MAC_H_ |
+ |
+#import "base/mac/scoped_nsobject.h" |
+#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" |
+#include "components/web_modal/single_web_contents_dialog_manager.h" |
+#include "components/web_modal/web_contents_modal_dialog_host.h" |
+ |
+ |
+// WebContents dialog manager for a Cocoa dialog parented off a views browser |
+// window. |
+class SingleWebContentsDialogManagerViewsMac |
+ : web_modal::SingleWebContentsDialogManager { |
+ public: |
+ SingleWebContentsDialogManagerViewsMac( |
+ id<ConstrainedWindowSheet> sheet, content::WebContents* web_contents); |
+ |
+ ~SingleWebContentsDialogManagerViewsMac() override; |
+ |
+ // Updates sheet position according to browser window and tab view sizes. |
+ void UpdateSheetPosition(); |
+ |
+ void Unhide(); |
+ |
+ // SingleWebContentsDialogManager: |
+ void Show() override; |
+ void Hide() override; |
+ void Close() override; |
+ void Focus() override; |
+ void Pulse() override; |
+ void HostChanged(web_modal::WebContentsModalDialogHost* new_host) override; |
+ gfx::NativeWindow dialog() override; |
+ |
+ private: |
+ base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; |
+ web_modal::SingleWebContentsDialogManagerDelegate* delegate_; |
+ |
+ bool visible_; |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_MAC_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_MAC_H_ |