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

Unified Diff: chrome/browser/ui/cocoa/tab_dialogs_views_mac.mm

Issue 2539673003: Mac: Convert all the TabDialogs to Harmony (Closed)
Patch Set: Created 4 years, 1 month 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/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);
+}
« no previous file with comments | « chrome/browser/ui/cocoa/tab_dialogs_cocoa.mm ('k') | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698