| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_infobar_module.h" | 5 #include "chrome/browser/extensions/extension_infobar_module.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/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| 11 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 11 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 12 #include "chrome/browser/extensions/extension_infobar_module_constants.h" | 12 #include "chrome/browser/extensions/extension_infobar_module_constants.h" |
| 13 #include "chrome/browser/extensions/extension_tabs_module.h" | 13 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 14 #include "chrome/browser/extensions/extension_tabs_module_constants.h" | 14 #include "chrome/browser/extensions/extension_tabs_module_constants.h" |
| 15 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 15 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 16 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 18 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 19 #include "chrome/common/extensions/extension_error_utils.h" | 20 #include "chrome/common/extensions/extension_error_utils.h" |
| 20 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 21 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 22 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 23 | 24 |
| 24 namespace keys = extension_infobar_module_constants; | 25 namespace keys = extension_infobar_module_constants; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 49 &browser, | 50 &browser, |
| 50 NULL, | 51 NULL, |
| 51 &tab_contents, | 52 &tab_contents, |
| 52 NULL)) { | 53 NULL)) { |
| 53 error_ = ExtensionErrorUtils::FormatErrorMessage( | 54 error_ = ExtensionErrorUtils::FormatErrorMessage( |
| 54 extension_tabs_module_constants::kTabNotFoundError, | 55 extension_tabs_module_constants::kTabNotFoundError, |
| 55 base::IntToString(tab_id)); | 56 base::IntToString(tab_id)); |
| 56 return false; | 57 return false; |
| 57 } | 58 } |
| 58 | 59 |
| 59 tab_contents->AddInfoBar( | 60 tab_contents->infobar_tab_helper()->AddInfoBar( |
| 60 new ExtensionInfoBarDelegate(browser, tab_contents->tab_contents(), | 61 new ExtensionInfoBarDelegate(browser, tab_contents->tab_contents(), |
| 61 GetExtension(), url, height)); | 62 GetExtension(), url, height)); |
| 62 | 63 |
| 63 // TODO(finnur): Return the actual DOMWindow object. Bug 26463. | 64 // TODO(finnur): Return the actual DOMWindow object. Bug 26463. |
| 64 result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false)); | 65 result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false)); |
| 65 | 66 |
| 66 return true; | 67 return true; |
| 67 } | 68 } |
| OLD | NEW |