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/views/website_settings/permissions_bubble_view.h" | 5 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 frame->SetBubbleBorder(scoped_ptr<views::BubbleBorder>( | 388 frame->SetBubbleBorder(scoped_ptr<views::BubbleBorder>( |
389 new views::BubbleBorder(adjusted_arrow, shadow(), color()))); | 389 new views::BubbleBorder(adjusted_arrow, shadow(), color()))); |
390 | 390 |
391 // Reposition the bubble based on the updated arrow and view. | 391 // Reposition the bubble based on the updated arrow and view. |
392 SetAnchorView(anchor_view); | 392 SetAnchorView(anchor_view); |
393 } | 393 } |
394 | 394 |
395 ////////////////////////////////////////////////////////////////////////////// | 395 ////////////////////////////////////////////////////////////////////////////// |
396 // PermissionBubbleViewViews | 396 // PermissionBubbleViewViews |
397 | 397 |
| 398 // static |
| 399 PermissionBubbleView* PermissionBubbleView::Create(Browser* browser) { |
| 400 return new PermissionBubbleViewViews(browser); |
| 401 } |
| 402 |
398 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser) | 403 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser) |
399 : browser_(browser), | 404 : browser_(browser), |
400 delegate_(nullptr), | 405 delegate_(nullptr), |
401 bubble_delegate_(nullptr) {} | 406 bubble_delegate_(nullptr) {} |
402 | 407 |
403 PermissionBubbleViewViews::~PermissionBubbleViewViews() { | 408 PermissionBubbleViewViews::~PermissionBubbleViewViews() { |
404 if (delegate_) | 409 if (delegate_) |
405 delegate_->SetView(nullptr); | 410 delegate_->SetView(nullptr); |
406 } | 411 } |
407 | 412 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 487 |
483 void PermissionBubbleViewViews::Accept() { | 488 void PermissionBubbleViewViews::Accept() { |
484 if (delegate_) | 489 if (delegate_) |
485 delegate_->Accept(); | 490 delegate_->Accept(); |
486 } | 491 } |
487 | 492 |
488 void PermissionBubbleViewViews::Deny() { | 493 void PermissionBubbleViewViews::Deny() { |
489 if (delegate_) | 494 if (delegate_) |
490 delegate_->Deny(); | 495 delegate_->Deny(); |
491 } | 496 } |
OLD | NEW |