Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } |
| OLD | NEW |