| 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/download/download_feedback_dialog_view.h" | 5 #include "chrome/browser/ui/views/download/download_feedback_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 DialogStatusData* data = | 53 DialogStatusData* data = |
| 54 static_cast<DialogStatusData*>(profile->GetUserData(kDialogStatusKey)); | 54 static_cast<DialogStatusData*>(profile->GetUserData(kDialogStatusKey)); |
| 55 if (data == NULL) { | 55 if (data == NULL) { |
| 56 data = new DialogStatusData(); | 56 data = new DialogStatusData(); |
| 57 profile->SetUserData(kDialogStatusKey, data); | 57 profile->SetUserData(kDialogStatusKey, data); |
| 58 } | 58 } |
| 59 if (data->currently_shown() == false) { | 59 if (data->currently_shown() == false) { |
| 60 data->set_currently_shown(true); | 60 data->set_currently_shown(true); |
| 61 DownloadFeedbackDialogView* window = | 61 DownloadFeedbackDialogView* window = |
| 62 new DownloadFeedbackDialogView(profile, navigator, callback); | 62 new DownloadFeedbackDialogView(profile, navigator, callback); |
| 63 CreateBrowserModalDialogViews(window, parent_window)->Show(); | 63 CreateWindowModalDialogViews(window, parent_window)->Show(); |
| 64 } else { | 64 } else { |
| 65 callback.Run(false); | 65 callback.Run(false); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 DownloadFeedbackDialogView::DownloadFeedbackDialogView( | 69 DownloadFeedbackDialogView::DownloadFeedbackDialogView( |
| 70 Profile* profile, | 70 Profile* profile, |
| 71 content::PageNavigator* navigator, | 71 content::PageNavigator* navigator, |
| 72 const UserDecisionCallback& callback) | 72 const UserDecisionCallback& callback) |
| 73 : profile_(profile), | 73 : profile_(profile), |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 views::Link* source, int event_flags) { | 152 views::Link* source, int event_flags) { |
| 153 WindowOpenDisposition disposition = | 153 WindowOpenDisposition disposition = |
| 154 ui::DispositionFromEventFlags(event_flags); | 154 ui::DispositionFromEventFlags(event_flags); |
| 155 content::OpenURLParams params( | 155 content::OpenURLParams params( |
| 156 GURL(l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_URL)), | 156 GURL(l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_URL)), |
| 157 content::Referrer(), | 157 content::Referrer(), |
| 158 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, | 158 disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition, |
| 159 ui::PAGE_TRANSITION_LINK, false); | 159 ui::PAGE_TRANSITION_LINK, false); |
| 160 navigator_->OpenURL(params); | 160 navigator_->OpenURL(params); |
| 161 } | 161 } |
| OLD | NEW |