Chromium Code Reviews| 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_delegate.h" | 5 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/infobars/infobar.h" | 9 #include "chrome/browser/infobars/infobar.h" |
| 10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 content::Source<Profile>(browser->profile())); | 35 content::Source<Profile>(browser->profile())); |
| 36 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 36 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 37 content::Source<Profile>(browser->profile())); | 37 content::Source<Profile>(browser->profile())); |
| 38 | 38 |
| 39 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) | 39 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) |
| 40 int default_height = InfoBar::kDefaultBarTargetHeight; | 40 int default_height = InfoBar::kDefaultBarTargetHeight; |
| 41 #elif defined(OS_MACOSX) | 41 #elif defined(OS_MACOSX) |
| 42 // TODO(pkasting): Once Infobars have been ported to Mac, we can remove the | 42 // TODO(pkasting): Once Infobars have been ported to Mac, we can remove the |
| 43 // ifdefs and just use the Infobar constant below. | 43 // ifdefs and just use the Infobar constant below. |
| 44 int default_height = 36; | 44 int default_height = 36; |
| 45 #elif defined(OS_ANDROID) | |
| 46 // TODO(dtrainor): This is not used. Might need to pull this from Android UI | |
|
John Grabowski
2012/02/22 18:34:49
File a bug. Assign to yourself. Tag it somehow (
David Trainor- moved to gerrit
2012/02/22 19:10:19
Done.
| |
| 47 // level in the future. | |
| 48 int default_height = 36; | |
| 45 #endif | 49 #endif |
| 46 height_ = std::max(0, height); | 50 height_ = std::max(0, height); |
| 47 height_ = std::min(2 * default_height, height_); | 51 height_ = std::min(2 * default_height, height_); |
| 48 if (height_ == 0) | 52 if (height_ == 0) |
| 49 height_ = default_height; | 53 height_ = default_height; |
| 50 } | 54 } |
| 51 | 55 |
| 52 ExtensionInfoBarDelegate::~ExtensionInfoBarDelegate() { | 56 ExtensionInfoBarDelegate::~ExtensionInfoBarDelegate() { |
| 53 if (observer_) | 57 if (observer_) |
| 54 observer_->OnDelegateDeleted(); | 58 observer_->OnDelegateDeleted(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 if (extension_host_.get() == content::Details<ExtensionHost>(details).ptr()) | 95 if (extension_host_.get() == content::Details<ExtensionHost>(details).ptr()) |
| 92 RemoveSelf(); | 96 RemoveSelf(); |
| 93 } else { | 97 } else { |
| 94 DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED); | 98 DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED); |
| 95 if (extension_ == | 99 if (extension_ == |
| 96 content::Details<UnloadedExtensionInfo>(details)->extension) { | 100 content::Details<UnloadedExtensionInfo>(details)->extension) { |
| 97 RemoveSelf(); | 101 RemoveSelf(); |
| 98 } | 102 } |
| 99 } | 103 } |
| 100 } | 104 } |
| OLD | NEW |