From 277823276af8fb584020b981b30fbde5b4e7171d Mon Sep 17 00:00:00 2001 From: "miguelg@chromium.org" Date: Thu, 27 Jun 2013 09:09:12 +0000 Subject: [InfoBar] Enable the infobar classes for Android BUG=158817 Review URL: https://chromiumcodereview.appspot.com/17465010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208869 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/android/infobar_stubs.cc | 18 ------------------ chrome/browser/android/tab_android_test_stubs.cc | 12 ++++++++++++ chrome/browser/infobars/infobar.cc | 4 ++-- chrome/browser/infobars/infobar.h | 2 +- chrome/browser/infobars/infobar_container.cc | 4 ++-- 5 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 chrome/browser/android/infobar_stubs.cc (limited to 'chrome/browser') diff --git a/chrome/browser/android/infobar_stubs.cc b/chrome/browser/android/infobar_stubs.cc deleted file mode 100644 index 9316a7b..0000000 --- a/chrome/browser/android/infobar_stubs.cc +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/infobars/confirm_infobar_delegate.h" -#include "chrome/browser/translate/translate_infobar_delegate.h" - -// Clank implementations of cross-platform API, never used -// since infobars are created using the InfoBarFactory but we need -// them implemented so the binary links both upstream and downstream. -InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { - NOTREACHED() << "ConfirmInfoBar: InfoBarFactory should be used on Android"; - return NULL; -} - -InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { - return NULL; -} diff --git a/chrome/browser/android/tab_android_test_stubs.cc b/chrome/browser/android/tab_android_test_stubs.cc index af0dac2..b26ae5f 100644 --- a/chrome/browser/android/tab_android_test_stubs.cc +++ b/chrome/browser/android/tab_android_test_stubs.cc @@ -6,6 +6,8 @@ // needed to compile some tests. #include "chrome/browser/android/tab_android.h" +#include "chrome/browser/infobars/confirm_infobar_delegate.h" +#include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/browser/ui/auto_login_infobar_delegate.h" #include "chrome/browser/ui/auto_login_infobar_delegate_android.h" @@ -45,3 +47,13 @@ bool AutoLoginInfoBarDelegateAndroid::Register(JNIEnv* env) { return false; } +// static +InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { + NOTREACHED() << "ConfirmInfoBar: InfoBarFactory should be used on Android"; + return NULL; +} + +// static +InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { + return NULL; +} diff --git a/chrome/browser/infobars/infobar.cc b/chrome/browser/infobars/infobar.cc index 8a37ced..079b571 100644 --- a/chrome/browser/infobars/infobar.cc +++ b/chrome/browser/infobars/infobar.cc @@ -37,7 +37,7 @@ SkColor GetInfoBarBottomColor(InfoBarDelegate::Type infobar_type) { } // TODO(pkasting): Port Mac to use this. -#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) +#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) || defined(OS_ANDROID) InfoBar::InfoBar(InfoBarService* owner, InfoBarDelegate* delegate) : owner_(owner), @@ -188,4 +188,4 @@ void InfoBar::MaybeDelete() { } } -#endif // TOOLKIT_VIEWS || TOOLKIT_GTK +#endif // TOOLKIT_VIEWS || TOOLKIT_GTK || OS_ANDROID diff --git a/chrome/browser/infobars/infobar.h b/chrome/browser/infobars/infobar.h index eab823e..1c0fbb9 100644 --- a/chrome/browser/infobars/infobar.h +++ b/chrome/browser/infobars/infobar.h @@ -27,7 +27,7 @@ typedef std::pair InfoBarRemovedDetails; typedef std::pair InfoBarReplacedDetails; // TODO(pkasting): Port Mac to use this. -#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) +#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) || defined(OS_ANDROID) class InfoBarContainer; class InfoBarService; diff --git a/chrome/browser/infobars/infobar_container.cc b/chrome/browser/infobars/infobar_container.cc index bb13a07..9b8ce11 100644 --- a/chrome/browser/infobars/infobar_container.cc +++ b/chrome/browser/infobars/infobar_container.cc @@ -5,7 +5,7 @@ #include "build/build_config.h" // TODO(pkasting): Port Mac to use this. -#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) +#if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) || defined(OS_ANDROID) #include "chrome/browser/infobars/infobar_container.h" @@ -265,4 +265,4 @@ int InfoBarContainer::ArrowTargetHeightForInfoBar(size_t infobar_index) const { first_infobar_animation.GetCurrentValue()); } -#endif // TOOLKIT_VIEWS || defined(TOOLKIT_GTK) +#endif // TOOLKIT_VIEWS || defined(TOOLKIT_GTK) || defined(OS_ANDROID) -- cgit v1.1