Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc

Issue 2007833002: Delete FullscreenInfoBarDelegate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fullscreen-android-remove-flag
Patch Set: More cleanup suggested by Ted. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc
diff --git a/chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc b/chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc
deleted file mode 100644
index bf31c3a3d1fd9c2f4d046eea44b0148a7a6c9151..0000000000000000000000000000000000000000
--- a/chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2015 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/android/fullscreen/fullscreen_infobar_delegate.h"
-
-#include <memory>
-
-#include "base/android/jni_string.h"
-#include "base/memory/ptr_util.h"
-#include "chrome/browser/android/android_theme_resources.h"
-#include "chrome/browser/android/tab_android.h"
-#include "chrome/browser/infobars/infobar_service.h"
-#include "chrome/grit/generated_resources.h"
-#include "components/infobars/core/infobar.h"
-#include "components/url_formatter/elide_url.h"
-#include "grit/components_strings.h"
-#include "jni/FullscreenInfoBarDelegate_jni.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "url/gurl.h"
-
-// static
-jlong LaunchFullscreenInfoBar(JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- const JavaParamRef<jobject>& tab) {
- TabAndroid* tab_android = TabAndroid::GetNativeTab(env, tab);
- GURL origin = tab_android->GetURL().GetOrigin();
- FullscreenInfoBarDelegate* delegate = new FullscreenInfoBarDelegate(
- env, obj, origin);
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(tab_android->web_contents());
- infobar_service->AddInfoBar(
- infobar_service->CreateConfirmInfoBar(base::WrapUnique(delegate)));
- return reinterpret_cast<intptr_t>(delegate);
-}
-
-bool FullscreenInfoBarDelegate::RegisterFullscreenInfoBarDelegate(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-FullscreenInfoBarDelegate::FullscreenInfoBarDelegate(
- JNIEnv* env, jobject obj, GURL origin)
- : origin_(origin) {
- j_delegate_.Reset(env, obj);
-}
-
-FullscreenInfoBarDelegate::~FullscreenInfoBarDelegate() {
- if (!j_delegate_.is_null()) {
- Java_FullscreenInfoBarDelegate_onInfoBarDismissed(
- base::android::AttachCurrentThread(), j_delegate_.obj());
- }
-}
-
-void FullscreenInfoBarDelegate::CloseFullscreenInfoBar(
- JNIEnv* env,
- const JavaParamRef<jobject>& obj) {
- j_delegate_.Reset();
- if (infobar() && infobar()->owner())
- infobar()->owner()->RemoveInfoBar(infobar());
-}
-
-infobars::InfoBarDelegate::InfoBarIdentifier
-FullscreenInfoBarDelegate::GetIdentifier() const {
- return FULLSCREEN_INFOBAR_DELEGATE;
-}
-
-int FullscreenInfoBarDelegate::GetIconId() const {
- return IDR_ANDROID_INFOBAR_FULLSCREEN;
-}
-
-base::string16 FullscreenInfoBarDelegate::GetMessageText() const {
- return l10n_util::GetStringFUTF16(
- IDS_FULLSCREEN_INFOBAR_TEXT,
- url_formatter::FormatUrlForSecurityDisplay(origin_));
-}
-
-base::string16 FullscreenInfoBarDelegate::GetButtonLabel(
- InfoBarButton button) const {
- return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
- IDS_FULLSCREEN_INFOBAR_ALLOW_BUTTON :
- IDS_FULLSCREEN_INFOBAR_EXIT_FULLSCREEN_BUTTON);
-}
-
-bool FullscreenInfoBarDelegate::Accept() {
- JNIEnv* env = base::android::AttachCurrentThread();
- ScopedJavaLocalRef<jstring> j_origin =
- base::android::ConvertUTF8ToJavaString(env, origin_.spec());
- Java_FullscreenInfoBarDelegate_onFullscreenAllowed(
- env, j_delegate_.obj(), j_origin.obj());
- return true;
-}
-
-bool FullscreenInfoBarDelegate::Cancel() {
- Java_FullscreenInfoBarDelegate_onFullscreenCancelled(
- base::android::AttachCurrentThread(), j_delegate_.obj());
- return true;
-}
« no previous file with comments | « chrome/browser/android/fullscreen/fullscreen_infobar_delegate.h ('k') | chrome/browser/android/resource_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698