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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void InfoBarService::RenderProcessGone(base::TerminationStatus status) { | 101 void InfoBarService::RenderProcessGone(base::TerminationStatus status) { |
102 RemoveAllInfoBars(true); | 102 RemoveAllInfoBars(true); |
103 } | 103 } |
104 | 104 |
105 void InfoBarService::NavigationEntryCommitted( | 105 void InfoBarService::NavigationEntryCommitted( |
106 const content::LoadCommittedDetails& load_details) { | 106 const content::LoadCommittedDetails& load_details) { |
107 OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details)); | 107 OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details)); |
108 } | 108 } |
109 | 109 |
110 void InfoBarService::WebContentsDestroyed(content::WebContents* web_contents) { | 110 void InfoBarService::WebContentsDestroyed() { |
111 // The WebContents is going away; be aggressively paranoid and delete | 111 // The WebContents is going away; be aggressively paranoid and delete |
112 // ourselves lest other parts of the system attempt to add infobars or use | 112 // ourselves lest other parts of the system attempt to add infobars or use |
113 // us otherwise during the destruction. | 113 // us otherwise during the destruction. |
114 web_contents->RemoveUserData(UserDataKey()); | 114 web_contents()->RemoveUserData(UserDataKey()); |
115 // That was the equivalent of "delete this". This object is now destroyed; | 115 // That was the equivalent of "delete this". This object is now destroyed; |
116 // returning from this function is the only safe thing to do. | 116 // returning from this function is the only safe thing to do. |
117 } | 117 } |
118 | 118 |
119 bool InfoBarService::OnMessageReceived(const IPC::Message& message) { | 119 bool InfoBarService::OnMessageReceived(const IPC::Message& message) { |
120 bool handled = true; | 120 bool handled = true; |
121 IPC_BEGIN_MESSAGE_MAP(InfoBarService, message) | 121 IPC_BEGIN_MESSAGE_MAP(InfoBarService, message) |
122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent, | 122 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockDisplayingInsecureContent, |
123 OnDidBlockDisplayingInsecureContent) | 123 OnDidBlockDisplayingInsecureContent) |
124 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockRunningInsecureContent, | 124 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidBlockRunningInsecureContent, |
125 OnDidBlockRunningInsecureContent) | 125 OnDidBlockRunningInsecureContent) |
126 IPC_MESSAGE_UNHANDLED(handled = false) | 126 IPC_MESSAGE_UNHANDLED(handled = false) |
127 IPC_END_MESSAGE_MAP() | 127 IPC_END_MESSAGE_MAP() |
128 return handled; | 128 return handled; |
129 } | 129 } |
130 | 130 |
131 void InfoBarService::OnDidBlockDisplayingInsecureContent() { | 131 void InfoBarService::OnDidBlockDisplayingInsecureContent() { |
132 InsecureContentInfoBarDelegate::Create( | 132 InsecureContentInfoBarDelegate::Create( |
133 this, InsecureContentInfoBarDelegate::DISPLAY); | 133 this, InsecureContentInfoBarDelegate::DISPLAY); |
134 } | 134 } |
135 | 135 |
136 void InfoBarService::OnDidBlockRunningInsecureContent() { | 136 void InfoBarService::OnDidBlockRunningInsecureContent() { |
137 InsecureContentInfoBarDelegate::Create(this, | 137 InsecureContentInfoBarDelegate::Create(this, |
138 InsecureContentInfoBarDelegate::RUN); | 138 InsecureContentInfoBarDelegate::RUN); |
139 } | 139 } |
OLD | NEW |