| 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/infobars/infobar_extension_api.h" | 5 #include "chrome/browser/infobars/infobar_extension_api.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 &browser, | 57 &browser, |
| 58 NULL, | 58 NULL, |
| 59 &web_contents, | 59 &web_contents, |
| 60 NULL)) { | 60 NULL)) { |
| 61 error_ = extensions::ErrorUtils::FormatErrorMessage( | 61 error_ = extensions::ErrorUtils::FormatErrorMessage( |
| 62 extensions::tabs_constants::kTabNotFoundError, | 62 extensions::tabs_constants::kTabNotFoundError, |
| 63 base::IntToString(tab_id)); | 63 base::IntToString(tab_id)); |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 InfoBarService* infobar_service = | 67 ExtensionInfoBarDelegate::Create( |
| 68 InfoBarService::FromWebContents(web_contents); | 68 InfoBarService::FromWebContents(web_contents), browser, GetExtension(), |
| 69 infobar_service->AddInfoBar( | 69 url, height); |
| 70 new ExtensionInfoBarDelegate(browser, infobar_service, | |
| 71 GetExtension(), url, height)); | |
| 72 | 70 |
| 73 // TODO(finnur): Return the actual DOMWindow object. Bug 26463. | 71 // TODO(finnur): Return the actual DOMWindow object. Bug 26463. |
| 74 DCHECK(browser->extension_window_controller()); | 72 DCHECK(browser->extension_window_controller()); |
| 75 SetResult(browser->extension_window_controller()->CreateWindowValue()); | 73 SetResult(browser->extension_window_controller()->CreateWindowValue()); |
| 76 | 74 |
| 77 return true; | 75 return true; |
| 78 } | 76 } |
| OLD | NEW |