OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/website_settings_popup_view.h " | 5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/certificate_viewer.h" | 9 #include "chrome/browser/certificate_viewer.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 tab_contents->infobar_tab_helper(), | 327 tab_contents->infobar_tab_helper(), |
328 url, | 328 url, |
329 ssl, | 329 ssl, |
330 content::CertStore::GetInstance())); | 330 content::CertStore::GetInstance())); |
331 } | 331 } |
332 } | 332 } |
333 | 333 |
334 void WebsiteSettingsPopupView::OnPermissionChanged( | 334 void WebsiteSettingsPopupView::OnPermissionChanged( |
335 PermissionSelectorView* permission_selector) { | 335 PermissionSelectorView* permission_selector) { |
336 DCHECK(permission_selector); | 336 DCHECK(permission_selector); |
337 presenter_->OnSitePermissionChanged( | 337 presenter_->OnSitePermissionChanged( |
msw
2012/08/07 20:13:45
Perhaps comment that this won't be called (perms c
markusheintz_
2012/08/07 20:28:05
Done.
| |
338 permission_selector->GetPermissionType(), | 338 permission_selector->GetPermissionType(), |
339 permission_selector->GetSelectedSetting()); | 339 permission_selector->GetSelectedSetting()); |
340 } | 340 } |
341 | 341 |
342 gfx::Rect WebsiteSettingsPopupView::GetAnchorRect() { | 342 gfx::Rect WebsiteSettingsPopupView::GetAnchorRect() { |
343 // Compensate for some built-in padding in the icon. This will make the arrow | 343 // Compensate for some built-in padding in the icon. This will make the arrow |
344 // point to the middle of the icon. | 344 // point to the middle of the icon. |
345 gfx::Rect anchor(BubbleDelegateView::GetAnchorRect()); | 345 gfx::Rect anchor(BubbleDelegateView::GetAnchorRect()); |
346 anchor.Inset(0, anchor_view() ? kLocationIconBottomMargin : 0); | 346 anchor.Inset(0, anchor_view() ? kLocationIconBottomMargin : 0); |
347 return anchor; | 347 return anchor; |
348 } | 348 } |
349 | 349 |
350 void WebsiteSettingsPopupView::OnWidgetClosing(views::Widget* widget) { | 350 void WebsiteSettingsPopupView::OnWidgetClosing(views::Widget* widget) { |
351 presenter_->OnUIClosing(); | 351 if (presenter_.get()) |
352 presenter_->OnUIClosing(); | |
352 } | 353 } |
353 | 354 |
354 void WebsiteSettingsPopupView::ButtonPressed( | 355 void WebsiteSettingsPopupView::ButtonPressed( |
355 views::Button* button, | 356 views::Button* button, |
356 const views::Event& event) { | 357 const views::Event& event) { |
357 GetWidget()->Close(); | 358 GetWidget()->Close(); |
358 } | 359 } |
359 | 360 |
360 void WebsiteSettingsPopupView::LinkClicked(views::Link* source, | 361 void WebsiteSettingsPopupView::LinkClicked(views::Link* source, |
361 int event_flags) { | 362 int event_flags) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 | 696 |
696 if (link) { | 697 if (link) { |
697 content_layout->StartRow(1, 0); | 698 content_layout->StartRow(1, 0); |
698 content_layout->AddView(link); | 699 content_layout->AddView(link); |
699 } | 700 } |
700 | 701 |
701 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, | 702 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, |
702 views::GridLayout::LEADING); | 703 views::GridLayout::LEADING); |
703 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); | 704 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); |
704 } | 705 } |
OLD | NEW |