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/hung_plugin_tab_helper.h" | 5 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 base::string16 message_; | 155 base::string16 message_; |
156 base::string16 button_text_; | 156 base::string16 button_text_; |
157 }; | 157 }; |
158 | 158 |
159 // static | 159 // static |
160 infobars::InfoBar* HungPluginInfoBarDelegate::Create( | 160 infobars::InfoBar* HungPluginInfoBarDelegate::Create( |
161 InfoBarService* infobar_service, | 161 InfoBarService* infobar_service, |
162 HungPluginTabHelper* helper, | 162 HungPluginTabHelper* helper, |
163 int plugin_child_id, | 163 int plugin_child_id, |
164 const base::string16& plugin_name) { | 164 const base::string16& plugin_name) { |
165 return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 165 return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
166 scoped_ptr<ConfirmInfoBarDelegate>(new HungPluginInfoBarDelegate( | 166 scoped_ptr<ConfirmInfoBarDelegate>(new HungPluginInfoBarDelegate( |
167 helper, plugin_child_id, plugin_name)))); | 167 helper, plugin_child_id, plugin_name)))); |
168 } | 168 } |
169 | 169 |
170 HungPluginInfoBarDelegate::HungPluginInfoBarDelegate( | 170 HungPluginInfoBarDelegate::HungPluginInfoBarDelegate( |
171 HungPluginTabHelper* helper, | 171 HungPluginTabHelper* helper, |
172 int plugin_child_id, | 172 int plugin_child_id, |
173 const base::string16& plugin_name) | 173 const base::string16& plugin_name) |
174 : ConfirmInfoBarDelegate(), | 174 : ConfirmInfoBarDelegate(), |
175 helper_(helper), | 175 helper_(helper), |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 | 415 |
416 void HungPluginTabHelper::CloseBar(PluginState* state) { | 416 void HungPluginTabHelper::CloseBar(PluginState* state) { |
417 InfoBarService* infobar_service = | 417 InfoBarService* infobar_service = |
418 InfoBarService::FromWebContents(web_contents()); | 418 InfoBarService::FromWebContents(web_contents()); |
419 if (infobar_service && state->infobar) { | 419 if (infobar_service && state->infobar) { |
420 infobar_service->RemoveInfoBar(state->infobar); | 420 infobar_service->RemoveInfoBar(state->infobar); |
421 state->infobar = NULL; | 421 state->infobar = NULL; |
422 } | 422 } |
423 } | 423 } |
OLD | NEW |