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

Side by Side Diff: chrome/browser/ui/views/chrome_constrained_window_views_client.cc

Issue 699553002: MacViews: Add a CreateChromeConstrainedWindowViewsClient stub (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/chrome_constrained_window_views_client_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" 5 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
6 6
7 #include "chrome/browser/ui/browser_finder.h" 7 #include "chrome/browser/ui/browser_finder.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "extensions/browser/guest_view/guest_view_base.h" 9 #include "extensions/browser/guest_view/guest_view_base.h"
10 10
11 namespace { 11 namespace {
12 12
13 class ChromeConstrainedWindowViewsClient 13 class ChromeConstrainedWindowViewsClient
14 : public ConstrainedWindowViewsClient { 14 : public ConstrainedWindowViewsClient {
15 public: 15 public:
16 ChromeConstrainedWindowViewsClient() {} 16 ChromeConstrainedWindowViewsClient() {}
17 ~ChromeConstrainedWindowViewsClient() override {} 17 ~ChromeConstrainedWindowViewsClient() override {}
18 18
19 private: 19 private:
20 // ConstrainedWindowViewsClient: 20 // ConstrainedWindowViewsClient:
21 content::WebContents* GetEmbedderWebContents( 21 content::WebContents* GetEmbedderWebContents(
22 content::WebContents* initiator_web_contents) override { 22 content::WebContents* initiator_web_contents) override {
23 extensions::GuestViewBase* guest_view = 23 extensions::GuestViewBase* guest_view =
24 extensions::GuestViewBase::FromWebContents(initiator_web_contents); 24 extensions::GuestViewBase::FromWebContents(initiator_web_contents);
25 return guest_view && guest_view->embedder_web_contents() ? 25 return guest_view && guest_view->embedder_web_contents() ?
26 guest_view->embedder_web_contents() : initiator_web_contents; 26 guest_view->embedder_web_contents() : initiator_web_contents;
27 } 27 }
28 web_modal::ModalDialogHost* GetModalDialogHost( 28 web_modal::ModalDialogHost* GetModalDialogHost(
29 gfx::NativeWindow parent) override { 29 gfx::NativeView parent) override {
30 // Get the browser dialog management and hosting components from |parent|. 30 // Get the browser dialog management and hosting components from |parent|.
31 Browser* browser = chrome::FindBrowserWithWindow(parent); 31 Browser* browser = chrome::FindBrowserWithWindow(parent);
tapted 2014/11/03 07:11:42 note this line only works on aura currently, but i
32 if (browser) { 32 if (browser) {
33 ChromeWebModalDialogManagerDelegate* manager = browser; 33 ChromeWebModalDialogManagerDelegate* manager = browser;
34 return manager->GetWebContentsModalDialogHost(); 34 return manager->GetWebContentsModalDialogHost();
35 } 35 }
36 return nullptr; 36 return nullptr;
37 } 37 }
38 38
39 DISALLOW_COPY_AND_ASSIGN(ChromeConstrainedWindowViewsClient); 39 DISALLOW_COPY_AND_ASSIGN(ChromeConstrainedWindowViewsClient);
40 }; 40 };
41 41
42 } // namespace 42 } // namespace
43 43
44 scoped_ptr<ConstrainedWindowViewsClient> 44 scoped_ptr<ConstrainedWindowViewsClient>
45 CreateChromeConstrainedWindowViewsClient() { 45 CreateChromeConstrainedWindowViewsClient() {
46 return make_scoped_ptr(new ChromeConstrainedWindowViewsClient); 46 return make_scoped_ptr(new ChromeConstrainedWindowViewsClient);
47 } 47 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/chrome_constrained_window_views_client_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698