Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
|
please use gerrit instead
2015/07/22 23:56:09
Separate this class into delegate, controller, bui
| |
| 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 <vector> | |
| 8 | |
| 7 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" | 13 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "chrome/browser/ui/views/frame/top_container_view.h" | 15 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| 14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 16 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 15 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 17 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 16 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" | 18 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 return views::BubbleBorder::NONE; | 440 return views::BubbleBorder::NONE; |
| 439 } | 441 } |
| 440 | 442 |
| 441 void PermissionBubbleViewViews::SetDelegate(Delegate* delegate) { | 443 void PermissionBubbleViewViews::SetDelegate(Delegate* delegate) { |
| 442 delegate_ = delegate; | 444 delegate_ = delegate; |
| 443 } | 445 } |
| 444 | 446 |
| 445 void PermissionBubbleViewViews::Show( | 447 void PermissionBubbleViewViews::Show( |
| 446 const std::vector<PermissionBubbleRequest*>& requests, | 448 const std::vector<PermissionBubbleRequest*>& requests, |
| 447 const std::vector<bool>& values) { | 449 const std::vector<bool>& values) { |
| 450 // TODO(hcarmona): refactor out the window/widget creation. | |
| 448 if (bubble_delegate_) | 451 if (bubble_delegate_) |
| 449 bubble_delegate_->Close(); | 452 bubble_delegate_->Close(); |
| 450 | 453 |
| 451 bubble_delegate_ = | 454 bubble_delegate_ = |
| 452 new PermissionsBubbleDelegateView( | 455 new PermissionsBubbleDelegateView( |
| 453 GetAnchorView(), GetAnchorArrow(), this, | 456 GetAnchorView(), GetAnchorArrow(), this, |
| 454 browser_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages), | 457 browser_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 455 requests, values); | 458 requests, values); |
| 456 | 459 |
| 457 // Set |parent_window| because some valid anchors can become hidden. | 460 // Set |parent_window| because some valid anchors can become hidden. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 503 | 506 |
| 504 void PermissionBubbleViewViews::Accept() { | 507 void PermissionBubbleViewViews::Accept() { |
| 505 if (delegate_) | 508 if (delegate_) |
| 506 delegate_->Accept(); | 509 delegate_->Accept(); |
| 507 } | 510 } |
| 508 | 511 |
| 509 void PermissionBubbleViewViews::Deny() { | 512 void PermissionBubbleViewViews::Deny() { |
| 510 if (delegate_) | 513 if (delegate_) |
| 511 delegate_->Deny(); | 514 delegate_->Deny(); |
| 512 } | 515 } |
| OLD | NEW |