OLD | NEW |
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/cocoa/website_settings/permission_bubble_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_window.h" | 7 #include "chrome/browser/ui/browser_window.h" |
8 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 8 #import "chrome/browser/ui/cocoa/base_bubble_controller.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_controller.h
" | 11 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" |
12 #import "chrome/browser/ui/website_settings/permission_bubble_view.h" | 12 #import "chrome/browser/ui/website_settings/permission_bubble_view.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #import "ui/base/cocoa/nsview_additions.h" | 14 #import "ui/base/cocoa/nsview_additions.h" |
15 | 15 |
| 16 // static |
| 17 PermissionBubbleView* PermissionBubbleView::Create(Browser* browser) { |
| 18 return new PermissionBubbleCocoa(browser); |
| 19 } |
| 20 |
16 PermissionBubbleCocoa::PermissionBubbleCocoa(Browser* browser) | 21 PermissionBubbleCocoa::PermissionBubbleCocoa(Browser* browser) |
17 : parent_window_(nil), delegate_(NULL), bubbleController_(nil) { | 22 : parent_window_(nil), delegate_(NULL), bubbleController_(nil) { |
18 parent_window_ = browser->window()->GetNativeWindow(); | 23 parent_window_ = browser->window()->GetNativeWindow(); |
19 } | 24 } |
20 | 25 |
21 PermissionBubbleCocoa::~PermissionBubbleCocoa() { | 26 PermissionBubbleCocoa::~PermissionBubbleCocoa() { |
22 if (delegate_) | 27 if (delegate_) |
23 delegate_->SetView(NULL); | 28 delegate_->SetView(NULL); |
24 } | 29 } |
25 | 30 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // will have a location_bar_bridge but not have a location bar. | 102 // will have a location_bar_bridge but not have a location bar. |
98 return location_bar_bridge->browser()->SupportsWindowFeature( | 103 return location_bar_bridge->browser()->SupportsWindowFeature( |
99 Browser::FEATURE_LOCATIONBAR); | 104 Browser::FEATURE_LOCATIONBAR); |
100 } | 105 } |
101 return false; | 106 return false; |
102 } | 107 } |
103 | 108 |
104 info_bubble::BubbleArrowLocation PermissionBubbleCocoa::GetArrowLocation() { | 109 info_bubble::BubbleArrowLocation PermissionBubbleCocoa::GetArrowLocation() { |
105 return HasLocationBar() ? info_bubble::kTopLeft : info_bubble::kNoArrow; | 110 return HasLocationBar() ? info_bubble::kTopLeft : info_bubble::kNoArrow; |
106 } | 111 } |
OLD | NEW |