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_finder.h" | 7 #include "chrome/browser/ui/browser_finder.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" |
11 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" | 11 #import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h" |
12 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" | 12 #import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.
h" |
13 #include "chrome/browser/ui/views/website_settings/permission_prompt_impl.h" | 13 #include "chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h" |
14 #import "ui/base/cocoa/cocoa_base_utils.h" | 14 #import "ui/base/cocoa/cocoa_base_utils.h" |
15 #include "ui/base/material_design/material_design_controller.h" | 15 #include "ui/base/material_design/material_design_controller.h" |
16 #import "ui/gfx/mac/coordinate_conversion.h" | 16 #import "ui/gfx/mac/coordinate_conversion.h" |
17 | 17 |
18 // Implementation of PermissionPromptImpl's anchor methods for Cocoa | 18 // Implementation of PermissionPromptImpl's anchor methods for Cocoa |
19 // browsers. In Cocoa browsers there is no parent views::View for the permission | 19 // browsers. In Cocoa browsers there is no parent views::View for the permission |
20 // bubble, so these methods supply an anchor point instead. | 20 // bubble, so these methods supply an anchor point instead. |
21 | 21 |
22 views::View* PermissionPromptImpl::GetAnchorView() { | 22 views::View* PermissionPromptImpl::GetAnchorView() { |
23 return nullptr; | 23 return nullptr; |
(...skipping 11 matching lines...) Expand all Loading... |
35 // static | 35 // static |
36 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( | 36 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( |
37 content::WebContents* web_contents) { | 37 content::WebContents* web_contents) { |
38 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { | 38 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
39 return base::WrapUnique(new PermissionPromptImpl( | 39 return base::WrapUnique(new PermissionPromptImpl( |
40 chrome::FindBrowserWithWebContents(web_contents))); | 40 chrome::FindBrowserWithWebContents(web_contents))); |
41 } | 41 } |
42 return base::MakeUnique<PermissionBubbleCocoa>( | 42 return base::MakeUnique<PermissionBubbleCocoa>( |
43 chrome::FindBrowserWithWebContents(web_contents)); | 43 chrome::FindBrowserWithWebContents(web_contents)); |
44 } | 44 } |
OLD | NEW |