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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm

Issue 464533002: Move guest_view to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made in guest_view_manager_unittest.cc Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cocoa/constrained_window/constrained_window_mac.h" 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/guest_view/web_view/web_view_guest.h" 8 #include "chrome/browser/guest_view/web_view/web_view_guest.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 10 matching lines...) Expand all
21 21
22 ConstrainedWindowMac::ConstrainedWindowMac( 22 ConstrainedWindowMac::ConstrainedWindowMac(
23 ConstrainedWindowMacDelegate* delegate, 23 ConstrainedWindowMacDelegate* delegate,
24 content::WebContents* web_contents, 24 content::WebContents* web_contents,
25 id<ConstrainedWindowSheet> sheet) 25 id<ConstrainedWindowSheet> sheet)
26 : delegate_(delegate), 26 : delegate_(delegate),
27 web_contents_(NULL), 27 web_contents_(NULL),
28 sheet_([sheet retain]), 28 sheet_([sheet retain]),
29 shown_(false) { 29 shown_(false) {
30 DCHECK(web_contents); 30 DCHECK(web_contents);
31 WebViewGuest* web_view_guest = WebViewGuest::FromWebContents(web_contents); 31 extensions::WebViewGuest* web_view_guest =
32 extensions::WebViewGuest::FromWebContents(web_contents);
32 // For embedded WebContents, use the embedder's WebContents for constrained 33 // For embedded WebContents, use the embedder's WebContents for constrained
33 // window. 34 // window.
34 web_contents_ = web_view_guest && web_view_guest->embedder_web_contents() ? 35 web_contents_ = web_view_guest && web_view_guest->embedder_web_contents() ?
35 web_view_guest->embedder_web_contents() : web_contents; 36 web_view_guest->embedder_web_contents() : web_contents;
36 DCHECK(sheet_.get()); 37 DCHECK(sheet_.get());
37 web_modal::PopupManager* popup_manager = 38 web_modal::PopupManager* popup_manager =
38 web_modal::PopupManager::FromWebContents(web_contents_); 39 web_modal::PopupManager::FromWebContents(web_contents_);
39 if (popup_manager) 40 if (popup_manager)
40 popup_manager->ShowModalDialog(this, web_contents_); 41 popup_manager->ShowModalDialog(this, web_contents_);
41 } 42 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 NSWindow* ConstrainedWindowMac::GetParentWindow() const { 94 NSWindow* ConstrainedWindowMac::GetParentWindow() const {
94 // Tab contents in a tabbed browser may not be inside a window. For this 95 // Tab contents in a tabbed browser may not be inside a window. For this
95 // reason use a browser window if possible. 96 // reason use a browser window if possible.
96 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); 97 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
97 if (browser) 98 if (browser)
98 return browser->window()->GetNativeWindow(); 99 return browser->window()->GetNativeWindow();
99 100
100 return web_contents_->GetTopLevelNativeWindow(); 101 return web_contents_->GetTopLevelNativeWindow();
101 } 102 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/extension_information.cc ('k') | chrome/browser/ui/views/constrained_window_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698