diff options
author | miguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 09:09:12 +0000 |
---|---|---|
committer | miguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 09:09:12 +0000 |
commit | 277823276af8fb584020b981b30fbde5b4e7171d (patch) | |
tree | 55f7af4ef205226ff954cfdc7d872388dd8aee6e | |
parent | d60c81a0455c34c6280f9603cba357e840419293 (diff) | |
download | chromium_src-277823276af8fb584020b981b30fbde5b4e7171d.zip chromium_src-277823276af8fb584020b981b30fbde5b4e7171d.tar.gz chromium_src-277823276af8fb584020b981b30fbde5b4e7171d.tar.bz2 |
[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
-rw-r--r-- | chrome/android/testshell/testshell_stubs.cc | 12 | ||||
-rw-r--r-- | chrome/browser/android/infobar_stubs.cc | 18 | ||||
-rw-r--r-- | chrome/browser/android/tab_android_test_stubs.cc | 12 | ||||
-rw-r--r-- | chrome/browser/infobars/infobar.cc | 4 | ||||
-rw-r--r-- | chrome/browser/infobars/infobar.h | 2 | ||||
-rw-r--r-- | chrome/browser/infobars/infobar_container.cc | 4 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 1 |
7 files changed, 29 insertions, 24 deletions
diff --git a/chrome/android/testshell/testshell_stubs.cc b/chrome/android/testshell/testshell_stubs.cc index fe10afb..b271b31 100644 --- a/chrome/android/testshell/testshell_stubs.cc +++ b/chrome/android/testshell/testshell_stubs.cc @@ -5,6 +5,7 @@ #include "base/strings/string16.h" #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 +46,14 @@ base::string16 AutoLoginInfoBarDelegateAndroid::GetMessageText() const { 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/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<InfoBarDelegate*, bool> InfoBarRemovedDetails; typedef std::pair<InfoBarDelegate*, InfoBarDelegate*> 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) diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 381db83..ebd3125 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -103,7 +103,6 @@ 'browser/android/favicon_helper.cc', 'browser/android/favicon_helper.h', 'browser/android/google_location_settings_helper.h', - 'browser/android/infobar_stubs.cc', 'browser/android/intent_helper.cc', 'browser/android/intent_helper.h', 'browser/android/intercept_download_resource_throttle.cc', |