Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/browser/infobars/infobar_service.cc

Issue 2167513002: Remove InsecureContentInfobarDelegate, which has been broken for a while (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix AW? Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
10 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
11 #include "components/content_settings/content/common/content_settings_messages.h " 10 #include "components/content_settings/content/common/content_settings_messages.h "
12 #include "components/infobars/core/infobar.h" 11 #include "components/infobars/core/infobar.h"
13 #include "content/public/browser/navigation_details.h" 12 #include "content/public/browser/navigation_details.h"
14 #include "content/public/browser/navigation_entry.h" 13 #include "content/public/browser/navigation_entry.h"
15 #include "content/public/browser/notification_service.h" 14 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
17 #include "ui/base/page_transition_types.h" 16 #include "ui/base/page_transition_types.h"
18 17
19 18
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 107
109 void InfoBarService::WebContentsDestroyed() { 108 void InfoBarService::WebContentsDestroyed() {
110 // The WebContents is going away; be aggressively paranoid and delete 109 // The WebContents is going away; be aggressively paranoid and delete
111 // ourselves lest other parts of the system attempt to add infobars or use 110 // ourselves lest other parts of the system attempt to add infobars or use
112 // us otherwise during the destruction. 111 // us otherwise during the destruction.
113 web_contents()->RemoveUserData(UserDataKey()); 112 web_contents()->RemoveUserData(UserDataKey());
114 // That was the equivalent of "delete this". This object is now destroyed; 113 // That was the equivalent of "delete this". This object is now destroyed;
115 // returning from this function is the only safe thing to do. 114 // returning from this function is the only safe thing to do.
116 } 115 }
117 116
118 bool InfoBarService::OnMessageReceived(const IPC::Message& message) {
119 bool handled = true;
120 IPC_BEGIN_MESSAGE_MAP(InfoBarService, message)
121 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent,
122 OnDidBlockDisplayingInsecureContent)
123 IPC_MESSAGE_UNHANDLED(handled = false)
124 IPC_END_MESSAGE_MAP()
125 return handled;
126 }
127
128 void InfoBarService::OnDidBlockDisplayingInsecureContent() {
129 InsecureContentInfoBarDelegate::Create(this);
130 }
131
132 void InfoBarService::OpenURL(const GURL& url, 117 void InfoBarService::OpenURL(const GURL& url,
133 WindowOpenDisposition disposition) { 118 WindowOpenDisposition disposition) {
134 // A normal user click on an infobar URL will result in a CURRENT_TAB 119 // A normal user click on an infobar URL will result in a CURRENT_TAB
135 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up 120 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up
136 // smashing the page the user is looking at. 121 // smashing the page the user is looking at.
137 web_contents()->OpenURL(content::OpenURLParams( 122 web_contents()->OpenURL(content::OpenURLParams(
138 url, content::Referrer(), 123 url, content::Referrer(),
139 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 124 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
140 ui::PAGE_TRANSITION_LINK, false)); 125 ui::PAGE_TRANSITION_LINK, false));
141 } 126 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_service.h ('k') | chrome/browser/infobars/insecure_content_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698