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

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

Issue 1140223003: [PermissionBubble] identical ctor across platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permbubble
Patch Set: Allow nil browser for ctor, for unit test use. Created 5 years, 7 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 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 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 8 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
9 #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"
10 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h " 11 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h "
11 #import "chrome/browser/ui/website_settings/permission_bubble_view.h" 12 #import "chrome/browser/ui/website_settings/permission_bubble_view.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #import "ui/base/cocoa/nsview_additions.h" 14 #import "ui/base/cocoa/nsview_additions.h"
14 15
15 PermissionBubbleCocoa::PermissionBubbleCocoa(NSWindow* parent_window) 16 PermissionBubbleCocoa::PermissionBubbleCocoa(Browser* browser)
16 : parent_window_(parent_window), delegate_(NULL), bubbleController_(nil) {} 17 : parent_window_(nil), delegate_(NULL), bubbleController_(nil) {
Robert Sesek 2015/05/19 22:28:00 nullptr here?
groby-ooo-7-16 2015/05/20 01:12:47 Hey, that's not *my* code :) Done.
18 // Browser is allowed to be nil for testing purposes.
Robert Sesek 2015/05/19 22:28:00 Browser is C++, so NULL not nil.
groby-ooo-7-16 2015/05/20 01:12:47 Well, nullptr :) Done.
19 if (browser)
20 parent_window_ = browser->window()->GetNativeWindow();
21 }
17 22
18 PermissionBubbleCocoa::~PermissionBubbleCocoa() { 23 PermissionBubbleCocoa::~PermissionBubbleCocoa() {
19 if (delegate_) 24 if (delegate_)
20 delegate_->SetView(NULL); 25 delegate_->SetView(NULL);
21 } 26 }
22 27
23 void PermissionBubbleCocoa::Show( 28 void PermissionBubbleCocoa::Show(
24 const std::vector<PermissionBubbleRequest*>& requests, 29 const std::vector<PermissionBubbleRequest*>& requests,
25 const std::vector<bool>& accept_state) { 30 const std::vector<bool>& accept_state) {
26 DCHECK(parent_window_); 31 DCHECK(parent_window_);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // will have a location_bar_bridge but not have a location bar. 99 // will have a location_bar_bridge but not have a location bar.
95 return location_bar_bridge->browser()->SupportsWindowFeature( 100 return location_bar_bridge->browser()->SupportsWindowFeature(
96 Browser::FEATURE_LOCATIONBAR); 101 Browser::FEATURE_LOCATIONBAR);
97 } 102 }
98 return false; 103 return false;
99 } 104 }
100 105
101 info_bubble::BubbleArrowLocation PermissionBubbleCocoa::GetArrowLocation() { 106 info_bubble::BubbleArrowLocation PermissionBubbleCocoa::GetArrowLocation() {
102 return HasLocationBar() ? info_bubble::kTopLeft : info_bubble::kNoArrow; 107 return HasLocationBar() ? info_bubble::kTopLeft : info_bubble::kNoArrow;
103 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698