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

Unified Diff: chrome/browser/ui/views/mac/web_contents_modal_dialog_manager_views_mac.h

Issue 1779383002: MacViews: Remove constrained window dependencies for certificate viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Position correctly (kind of) & block on tab only. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698