OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_delegate.h" | 5 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
11 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
12 #include "chrome/common/notification_details.h" | 12 #include "chrome/common/notification_details.h" |
13 #include "chrome/common/notification_source.h" | 13 #include "chrome/common/notification_source.h" |
14 #include "chrome/common/notification_type.h" | 14 #include "chrome/common/notification_type.h" |
15 | 15 |
16 ExtensionInfoBarDelegate::ExtensionInfoBarDelegate(Browser* browser, | 16 ExtensionInfoBarDelegate::ExtensionInfoBarDelegate(Browser* browser, |
17 TabContents* tab_contents, | 17 TabContents* tab_contents, |
18 Extension* extension, | 18 Extension* extension, |
19 const GURL& url) | 19 const GURL& url) |
20 : InfoBarDelegate(tab_contents), | 20 : InfoBarDelegate(tab_contents), |
21 observer_(NULL), | 21 observer_(NULL), |
22 extension_(extension), | 22 extension_(extension), |
23 tab_contents_(tab_contents) { | 23 tab_contents_(tab_contents), |
| 24 closing_(false) { |
24 ExtensionProcessManager* manager = | 25 ExtensionProcessManager* manager = |
25 browser->profile()->GetExtensionProcessManager(); | 26 browser->profile()->GetExtensionProcessManager(); |
26 extension_host_.reset(manager->CreateInfobar(url, browser)); | 27 extension_host_.reset(manager->CreateInfobar(url, browser)); |
27 extension_host_->set_associated_tab_contents(tab_contents); | 28 extension_host_->set_associated_tab_contents(tab_contents); |
28 | 29 |
29 registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 30 registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
30 Source<Profile>(browser->profile())); | 31 Source<Profile>(browser->profile())); |
31 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 32 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
32 Source<Profile>(browser->profile())); | 33 Source<Profile>(browser->profile())); |
33 } | 34 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (extension_ == extension) | 80 if (extension_ == extension) |
80 tab_contents_->RemoveInfoBar(this); | 81 tab_contents_->RemoveInfoBar(this); |
81 break; | 82 break; |
82 } | 83 } |
83 default: { | 84 default: { |
84 NOTREACHED() << "Unknown message"; | 85 NOTREACHED() << "Unknown message"; |
85 break; | 86 break; |
86 } | 87 } |
87 } | 88 } |
88 } | 89 } |
OLD | NEW |