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

Side by Side 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 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/tab_dialogs_views.h"
6
7 #import <Cocoa/Cocoa.h>
8
9 #include "chrome/browser/ui/cocoa/tab_dialogs_cocoa.h"
10 #include "content/public/browser/web_contents.h"
11
12 namespace {
13
14 // Implementation of TabDialogs interface for toolkit-views dialogs on Mac.
15 class TabDialogsViewsMac : public TabDialogsViews {
16 public:
17 explicit TabDialogsViewsMac(content::WebContents* contents);
18 ~TabDialogsViewsMac() override {}
19
20 // TabDialogs:
21 gfx::NativeView GetDialogParentView() const override;
22
23 private:
24 DISALLOW_COPY_AND_ASSIGN(TabDialogsViewsMac);
25 };
26
27 TabDialogsViewsMac::TabDialogsViewsMac(content::WebContents* contents)
28 : TabDialogsViews(contents) {}
29
30 // The browser is still Cocoa, so this matches TabDialogsCocoa.
31 gfx::NativeView TabDialogsViewsMac::GetDialogParentView() const {
32 // View hierarchy of the contents view:
33 // NSView -- switchView, same for all tabs
34 // +- TabContentsContainerView -- TabContentsController's view
35 // +- WebContentsViewCocoa
36 //
37 // Changing it? Do not forget to modify
38 // -[TabStripController swapInTabAtIndex:] too.
39 return [web_contents()->GetNativeView() superview];
40 }
41
42 } // namespace
43
44 // static
45 TabDialogs* TabDialogsCocoa::CreateTabDialogsViewsMac(
46 content::WebContents* contents) {
47 return new TabDialogsViewsMac(contents);
48 }
OLDNEW
« 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