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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(ConfirmInfoBarDelegate::CreateInfoBar( |
| 166 infobar_service, |
166 scoped_ptr<ConfirmInfoBarDelegate>(new HungPluginInfoBarDelegate( | 167 scoped_ptr<ConfirmInfoBarDelegate>(new HungPluginInfoBarDelegate( |
167 helper, plugin_child_id, plugin_name)))); | 168 helper, plugin_child_id, plugin_name)))); |
168 } | 169 } |
169 | 170 |
170 HungPluginInfoBarDelegate::HungPluginInfoBarDelegate( | 171 HungPluginInfoBarDelegate::HungPluginInfoBarDelegate( |
171 HungPluginTabHelper* helper, | 172 HungPluginTabHelper* helper, |
172 int plugin_child_id, | 173 int plugin_child_id, |
173 const base::string16& plugin_name) | 174 const base::string16& plugin_name) |
174 : ConfirmInfoBarDelegate(), | 175 : ConfirmInfoBarDelegate(), |
175 helper_(helper), | 176 helper_(helper), |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 415 } |
415 | 416 |
416 void HungPluginTabHelper::CloseBar(PluginState* state) { | 417 void HungPluginTabHelper::CloseBar(PluginState* state) { |
417 InfoBarService* infobar_service = | 418 InfoBarService* infobar_service = |
418 InfoBarService::FromWebContents(web_contents()); | 419 InfoBarService::FromWebContents(web_contents()); |
419 if (infobar_service && state->infobar) { | 420 if (infobar_service && state->infobar) { |
420 infobar_service->RemoveInfoBar(state->infobar); | 421 infobar_service->RemoveInfoBar(state->infobar); |
421 state->infobar = NULL; | 422 state->infobar = NULL; |
422 } | 423 } |
423 } | 424 } |
OLD | NEW |