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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 bool LinkClicked(WindowOpenDisposition disposition) override; | 89 bool LinkClicked(WindowOpenDisposition disposition) override; |
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(infobar_service->CreateConfirmInfoBar( |
100 scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error)))); | 100 scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error)))); |
101 } | 101 } |
102 | 102 |
103 ErrorInfoBarDelegate::ErrorInfoBarDelegate( | 103 ErrorInfoBarDelegate::ErrorInfoBarDelegate( |
104 const extensions::CrxInstallerError& error) | 104 const extensions::CrxInstallerError& error) |
105 : ConfirmInfoBarDelegate(), | 105 : ConfirmInfoBarDelegate(), |
106 error_(error) { | 106 error_(error) { |
107 } | 107 } |
108 | 108 |
109 ErrorInfoBarDelegate::~ErrorInfoBarDelegate() { | 109 ErrorInfoBarDelegate::~ErrorInfoBarDelegate() { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { | 255 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { |
256 Browser* browser = | 256 Browser* browser = |
257 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); | 257 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); |
258 if (browser) { | 258 if (browser) { |
259 content::WebContents* contents = | 259 content::WebContents* contents = |
260 browser->tab_strip_model()->GetActiveWebContents(); | 260 browser->tab_strip_model()->GetActiveWebContents(); |
261 return contents->GetTopLevelNativeWindow(); | 261 return contents->GetTopLevelNativeWindow(); |
262 } | 262 } |
263 return NULL; | 263 return NULL; |
264 } | 264 } |
OLD | NEW |