Chromium Code Reviews| Index: chrome/browser/infobars/infobar_delegate.cc |
| diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc |
| index e733f4390fe779305de4036c3fc476749db72aed..1a544e7f2369272197c2445c1a9745178a872d22 100644 |
| --- a/chrome/browser/infobars/infobar_delegate.cc |
| +++ b/chrome/browser/infobars/infobar_delegate.cc |
| @@ -7,17 +7,9 @@ |
| #include "base/logging.h" |
| #include "build/build_config.h" |
| #include "chrome/browser/infobars/infobar.h" |
| -#include "chrome/browser/infobars/infobar_service.h" |
| -#include "content/public/browser/navigation_controller.h" |
| -#include "content/public/browser/navigation_details.h" |
| -#include "content/public/browser/navigation_entry.h" |
| -#include "content/public/browser/web_contents.h" |
| +#include "chrome/browser/infobars/infobar_manager.h" |
| #include "ui/base/resource/resource_bundle.h" |
| -using content::NavigationEntry; |
| - |
| -// InfoBarDelegate ------------------------------------------------------------ |
| - |
| const int InfoBarDelegate::kNoIconID = 0; |
| InfoBarDelegate::~InfoBarDelegate() { |
| @@ -95,14 +87,10 @@ TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() { |
| } |
| void InfoBarDelegate::StoreActiveEntryUniqueID() { |
| - // TODO(droger): Remove this dependency on InfoBarService, see |
| - // http://crbug.com/354379. |
| - content::WebContents* web_contents = |
| - InfoBarService::WebContentsFromInfoBar(infobar()); |
| - DCHECK(web_contents); |
| - NavigationEntry* active_entry = |
| - web_contents->GetController().GetActiveEntry(); |
| - contents_unique_id_ = active_entry ? active_entry->GetUniqueID() : 0; |
| + int entry_id = 0; |
| + if (infobar() && infobar()->owner()) |
| + entry_id = infobar()->owner()->GetActiveEntryID(); |
|
droger
2014/04/09 16:10:52
We could maybe rename StoreActiveEntryUniqueID() a
Peter Kasting
2014/04/10 00:17:20
I don't have an opinion.
|
| + contents_unique_id_ = entry_id; |
|
Peter Kasting
2014/04/10 00:17:20
Nit: Shorter:
contents_unique_id_ = (infobar()
droger
2014/04/10 17:18:07
Done.
|
| } |
| gfx::Image InfoBarDelegate::GetIcon() const { |