| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 //////////////////////////////////////////////////////////////////////////////// | 270 //////////////////////////////////////////////////////////////////////////////// |
| 271 | 271 |
| 272 WebsiteSettingsPopupView::~WebsiteSettingsPopupView() { | 272 WebsiteSettingsPopupView::~WebsiteSettingsPopupView() { |
| 273 } | 273 } |
| 274 | 274 |
| 275 // static | 275 // static |
| 276 void WebsiteSettingsPopupView::ShowPopup(views::View* anchor_view, | 276 void WebsiteSettingsPopupView::ShowPopup(views::View* anchor_view, |
| 277 Profile* profile, | 277 Profile* profile, |
| 278 content::WebContents* web_contents, | 278 content::WebContents* web_contents, |
| 279 const GURL& url, | 279 const GURL& url, |
| 280 const content::SSLStatus& ssl, | 280 const content::SSLStatus& ssl) { |
| 281 Browser* browser) { | |
| 282 is_popup_showing = true; | 281 is_popup_showing = true; |
| 283 if (InternalChromePage(url)) { | 282 if (InternalChromePage(url)) { |
| 284 new InternalPageInfoPopupView(anchor_view); | 283 new InternalPageInfoPopupView(anchor_view); |
| 285 } else { | 284 } else { |
| 286 new WebsiteSettingsPopupView(anchor_view, profile, web_contents, url, ssl, | 285 new WebsiteSettingsPopupView(anchor_view, profile, web_contents, url, ssl); |
| 287 browser); | |
| 288 } | 286 } |
| 289 } | 287 } |
| 290 | 288 |
| 291 // static | 289 // static |
| 292 bool WebsiteSettingsPopupView::IsPopupShowing() { | 290 bool WebsiteSettingsPopupView::IsPopupShowing() { |
| 293 return is_popup_showing; | 291 return is_popup_showing; |
| 294 } | 292 } |
| 295 | 293 |
| 296 WebsiteSettingsPopupView::WebsiteSettingsPopupView( | 294 WebsiteSettingsPopupView::WebsiteSettingsPopupView( |
| 297 views::View* anchor_view, | 295 views::View* anchor_view, |
| 298 Profile* profile, | 296 Profile* profile, |
| 299 content::WebContents* web_contents, | 297 content::WebContents* web_contents, |
| 300 const GURL& url, | 298 const GURL& url, |
| 301 const content::SSLStatus& ssl, | 299 const content::SSLStatus& ssl) |
| 302 Browser* browser) | |
| 303 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), | 300 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), |
| 304 web_contents_(web_contents), | 301 web_contents_(web_contents), |
| 305 browser_(browser), | |
| 306 header_(nullptr), | 302 header_(nullptr), |
| 307 tabbed_pane_(nullptr), | 303 tabbed_pane_(nullptr), |
| 308 permissions_tab_(nullptr), | 304 permissions_tab_(nullptr), |
| 309 site_data_content_(nullptr), | 305 site_data_content_(nullptr), |
| 310 cookie_dialog_link_(nullptr), | 306 cookie_dialog_link_(nullptr), |
| 311 permissions_content_(nullptr), | 307 permissions_content_(nullptr), |
| 312 connection_tab_(nullptr), | 308 connection_tab_(nullptr), |
| 313 identity_info_content_(nullptr), | 309 identity_info_content_(nullptr), |
| 314 certificate_dialog_link_(nullptr), | 310 certificate_dialog_link_(nullptr), |
| 315 reset_decisions_button_(nullptr), | 311 reset_decisions_button_(nullptr), |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 | 794 |
| 799 if (web_contents_ != NULL) | 795 if (web_contents_ != NULL) |
| 800 new CollectedCookiesViews(web_contents_); | 796 new CollectedCookiesViews(web_contents_); |
| 801 } else if (source == certificate_dialog_link_) { | 797 } else if (source == certificate_dialog_link_) { |
| 802 gfx::NativeWindow parent = GetAnchorView() ? | 798 gfx::NativeWindow parent = GetAnchorView() ? |
| 803 GetAnchorView()->GetWidget()->GetNativeWindow() : nullptr; | 799 GetAnchorView()->GetWidget()->GetNativeWindow() : nullptr; |
| 804 presenter_->RecordWebsiteSettingsAction( | 800 presenter_->RecordWebsiteSettingsAction( |
| 805 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); | 801 WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); |
| 806 ShowCertificateViewerByID(web_contents_, parent, cert_id_); | 802 ShowCertificateViewerByID(web_contents_, parent, cert_id_); |
| 807 } else if (source == help_center_link_) { | 803 } else if (source == help_center_link_) { |
| 808 browser_->OpenURL( | 804 web_contents_->OpenURL(content::OpenURLParams( |
| 809 content::OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL), | 805 GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(), |
| 810 content::Referrer(), | 806 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); |
| 811 NEW_FOREGROUND_TAB, | |
| 812 ui::PAGE_TRANSITION_LINK, | |
| 813 false)); | |
| 814 presenter_->RecordWebsiteSettingsAction( | 807 presenter_->RecordWebsiteSettingsAction( |
| 815 WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); | 808 WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); |
| 816 } else if (source == site_settings_link_) { | 809 } else if (source == site_settings_link_) { |
| 817 // TODO(palmer): This opens the general Content Settings pane, which is OK | 810 // TODO(palmer): This opens the general Content Settings pane, which is OK |
| 818 // for now. But on Android, it opens a page specific to a given origin that | 811 // for now. But on Android, it opens a page specific to a given origin that |
| 819 // shows all of the settings for that origin. If/when that's available on | 812 // shows all of the settings for that origin. If/when that's available on |
| 820 // desktop we should link to that here, too. | 813 // desktop we should link to that here, too. |
| 821 browser_->OpenURL(content::OpenURLParams( | 814 web_contents_->OpenURL(content::OpenURLParams( |
| 822 GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), | 815 GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), |
| 823 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); | 816 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); |
| 824 presenter_->RecordWebsiteSettingsAction( | 817 presenter_->RecordWebsiteSettingsAction( |
| 825 WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED); | 818 WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED); |
| 826 } else { | 819 } else { |
| 827 NOTREACHED(); | 820 NOTREACHED(); |
| 828 } | 821 } |
| 829 } | 822 } |
| OLD | NEW |