| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 owner_(owner), | 199 owner_(owner), |
| 200 multiple_requests_(requests.size() > 1) { | 200 multiple_requests_(requests.size() > 1) { |
| 201 DCHECK(!requests.empty()); | 201 DCHECK(!requests.empty()); |
| 202 | 202 |
| 203 set_close_on_deactivate(false); | 203 set_close_on_deactivate(false); |
| 204 | 204 |
| 205 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, | 205 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, |
| 206 kItemMajorSpacing)); | 206 kItemMajorSpacing)); |
| 207 | 207 |
| 208 display_origin_ = url_formatter::FormatUrlForSecurityDisplay( | 208 display_origin_ = url_formatter::FormatUrlForSecurityDisplay( |
| 209 requests[0]->GetOrigin()); | 209 requests[0]->GetOrigin(), |
| 210 url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC); |
| 210 | 211 |
| 211 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 212 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 212 for (size_t index = 0; index < requests.size(); index++) { | 213 for (size_t index = 0; index < requests.size(); index++) { |
| 213 DCHECK(index < accept_state.size()); | 214 DCHECK(index < accept_state.size()); |
| 214 // The row is laid out containing a leading-aligned label area and a | 215 // The row is laid out containing a leading-aligned label area and a |
| 215 // trailing column which will be filled if there are multiple permission | 216 // trailing column which will be filled if there are multiple permission |
| 216 // requests. | 217 // requests. |
| 217 views::View* row = new views::View(); | 218 views::View* row = new views::View(); |
| 218 views::GridLayout* row_layout = new views::GridLayout(row); | 219 views::GridLayout* row_layout = new views::GridLayout(row); |
| 219 row->SetLayoutManager(row_layout); | 220 row->SetLayoutManager(row_layout); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 471 |
| 471 void PermissionBubbleViewViews::Accept() { | 472 void PermissionBubbleViewViews::Accept() { |
| 472 if (delegate_) | 473 if (delegate_) |
| 473 delegate_->Accept(); | 474 delegate_->Accept(); |
| 474 } | 475 } |
| 475 | 476 |
| 476 void PermissionBubbleViewViews::Deny() { | 477 void PermissionBubbleViewViews::Deny() { |
| 477 if (delegate_) | 478 if (delegate_) |
| 478 delegate_->Deny(); | 479 delegate_->Deny(); |
| 479 } | 480 } |
| OLD | NEW |