| 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/extensions/extension_install_ui_default.h" | 5 #include "chrome/browser/ui/extensions/extension_install_ui_default.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 10 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 extensions::CrxInstallerError error_; | 91 extensions::CrxInstallerError error_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(ErrorInfoBarDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(ErrorInfoBarDelegate); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 // static | 96 // static |
| 97 void ErrorInfoBarDelegate::Create(InfoBarService* infobar_service, | 97 void ErrorInfoBarDelegate::Create(InfoBarService* infobar_service, |
| 98 const extensions::CrxInstallerError& error) { | 98 const extensions::CrxInstallerError& error) { |
| 99 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 99 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
| 100 infobar_service, |
| 100 scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error)))); | 101 scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error)))); |
| 101 } | 102 } |
| 102 | 103 |
| 103 ErrorInfoBarDelegate::ErrorInfoBarDelegate( | 104 ErrorInfoBarDelegate::ErrorInfoBarDelegate( |
| 104 const extensions::CrxInstallerError& error) | 105 const extensions::CrxInstallerError& error) |
| 105 : ConfirmInfoBarDelegate(), | 106 : ConfirmInfoBarDelegate(), |
| 106 error_(error) { | 107 error_(error) { |
| 107 } | 108 } |
| 108 | 109 |
| 109 ErrorInfoBarDelegate::~ErrorInfoBarDelegate() { | 110 ErrorInfoBarDelegate::~ErrorInfoBarDelegate() { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { | 256 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { |
| 256 Browser* browser = | 257 Browser* browser = |
| 257 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); | 258 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); |
| 258 if (browser) { | 259 if (browser) { |
| 259 content::WebContents* contents = | 260 content::WebContents* contents = |
| 260 browser->tab_strip_model()->GetActiveWebContents(); | 261 browser->tab_strip_model()->GetActiveWebContents(); |
| 261 return contents->GetTopLevelNativeWindow(); | 262 return contents->GetTopLevelNativeWindow(); |
| 262 } | 263 } |
| 263 return NULL; | 264 return NULL; |
| 264 } | 265 } |
| OLD | NEW |