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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Helper class to put up an infobar when installation fails. | 73 // Helper class to put up an infobar when installation fails. |
74 class ErrorInfoBarDelegate : public ConfirmInfoBarDelegate { | 74 class ErrorInfoBarDelegate : public ConfirmInfoBarDelegate { |
75 public: | 75 public: |
76 // Creates an error infobar and delegate and adds the infobar to | 76 // Creates an error infobar and delegate and adds the infobar to |
77 // |infobar_service|. | 77 // |infobar_service|. |
78 static void Create(InfoBarService* infobar_service, | 78 static void Create(InfoBarService* infobar_service, |
79 const extensions::CrxInstallerError& error); | 79 const extensions::CrxInstallerError& error); |
80 | 80 |
81 private: | 81 private: |
82 explicit ErrorInfoBarDelegate(const extensions::CrxInstallerError& error); | 82 explicit ErrorInfoBarDelegate(const extensions::CrxInstallerError& error); |
83 virtual ~ErrorInfoBarDelegate(); | 83 ~ErrorInfoBarDelegate() override; |
84 | 84 |
85 // ConfirmInfoBarDelegate: | 85 // ConfirmInfoBarDelegate: |
86 virtual base::string16 GetMessageText() const override; | 86 base::string16 GetMessageText() const override; |
87 virtual int GetButtons() const override; | 87 int GetButtons() const override; |
88 virtual base::string16 GetLinkText() const override; | 88 base::string16 GetLinkText() const override; |
89 virtual 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(ConfirmInfoBarDelegate::CreateInfoBar( |
(...skipping 155 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 |