OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/infobars/infobar_service.h" | 5 #include "chrome/browser/infobars/infobar_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" | 9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent, | 122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent, |
123 OnDidBlockDisplayingInsecureContent) | 123 OnDidBlockDisplayingInsecureContent) |
124 IPC_MESSAGE_UNHANDLED(handled = false) | 124 IPC_MESSAGE_UNHANDLED(handled = false) |
125 IPC_END_MESSAGE_MAP() | 125 IPC_END_MESSAGE_MAP() |
126 return handled; | 126 return handled; |
127 } | 127 } |
128 | 128 |
129 void InfoBarService::OnDidBlockDisplayingInsecureContent() { | 129 void InfoBarService::OnDidBlockDisplayingInsecureContent() { |
130 InsecureContentInfoBarDelegate::Create(this); | 130 InsecureContentInfoBarDelegate::Create(this); |
131 } | 131 } |
| 132 |
| 133 void InfoBarService::OpenURL(const GURL& url, |
| 134 WindowOpenDisposition disposition) { |
| 135 // A normal user click on an infobar URL will result in a CURRENT_TAB |
| 136 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up |
| 137 // smashing the page the user is looking at. |
| 138 web_contents()->OpenURL(content::OpenURLParams( |
| 139 url, content::Referrer(), |
| 140 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 141 ui::PAGE_TRANSITION_LINK, false)); |
| 142 } |
OLD | NEW |