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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/permission_prompt_impl_views_mac.mm

Issue 2335623002: Use WebContents instead of Browser to construct PermissionPrompt (Closed)
Patch Set: Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 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 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 "base/memory/ptr_util.h" 5 #include "base/memory/ptr_util.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_dialogs.h" 7 #include "chrome/browser/ui/browser_dialogs.h"
8 #include "chrome/browser/ui/browser_window.h" 8 #include "chrome/browser/ui/browser_window.h"
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
10 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 10 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
(...skipping 14 matching lines...) Expand all
25 gfx::Point PermissionPromptImpl::GetAnchorPoint() { 25 gfx::Point PermissionPromptImpl::GetAnchorPoint() {
26 return gfx::ScreenPointFromNSPoint( 26 return gfx::ScreenPointFromNSPoint(
27 [PermissionBubbleController getAnchorPointForBrowser:browser_]); 27 [PermissionBubbleController getAnchorPointForBrowser:browser_]);
28 } 28 }
29 29
30 views::BubbleBorder::Arrow PermissionPromptImpl::GetAnchorArrow() { 30 views::BubbleBorder::Arrow PermissionPromptImpl::GetAnchorArrow() {
31 return views::BubbleBorder::TOP_LEFT; 31 return views::BubbleBorder::TOP_LEFT;
32 } 32 }
33 33
34 // static 34 // static
35 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create(Browser* browser) { 35 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create(
36 content::WebContents* web_contents) {
36 if (chrome::ToolkitViewsWebUIDialogsEnabled()) 37 if (chrome::ToolkitViewsWebUIDialogsEnabled())
37 return base::WrapUnique(new PermissionPromptImpl(browser)); 38 return base::WrapUnique(new PermissionPromptImpl(web_contents));
38 return base::MakeUnique<PermissionBubbleCocoa>(browser); 39 return base::MakeUnique<PermissionBubbleCocoa>(web_contents);
tapted 2016/09/15 03:43:52 Can this just be changed to pass `chrome::FindBrow
lshang 2016/09/15 09:45:06 Thanks for your detailed comment Trent! I think
39 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698