| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/fullscreen/fullscreen_infobar_delegate.h" | 5 #include "chrome/browser/android/fullscreen/fullscreen_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/android/android_theme_resources.h" | 10 #include "chrome/browser/android/android_theme_resources.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 void FullscreenInfoBarDelegate::CloseFullscreenInfoBar( | 55 void FullscreenInfoBarDelegate::CloseFullscreenInfoBar( |
| 56 JNIEnv* env, | 56 JNIEnv* env, |
| 57 const JavaParamRef<jobject>& obj) { | 57 const JavaParamRef<jobject>& obj) { |
| 58 j_delegate_.Reset(); | 58 j_delegate_.Reset(); |
| 59 if (infobar() && infobar()->owner()) | 59 if (infobar() && infobar()->owner()) |
| 60 infobar()->owner()->RemoveInfoBar(infobar()); | 60 infobar()->owner()->RemoveInfoBar(infobar()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 std::string FullscreenInfoBarDelegate::GetIdentifier() const { |
| 64 return "FullscreenInfoBarDelegate"; |
| 65 } |
| 66 |
| 63 int FullscreenInfoBarDelegate::GetIconId() const { | 67 int FullscreenInfoBarDelegate::GetIconId() const { |
| 64 return IDR_ANDROID_INFOBAR_FULLSCREEN; | 68 return IDR_ANDROID_INFOBAR_FULLSCREEN; |
| 65 } | 69 } |
| 66 | 70 |
| 67 base::string16 FullscreenInfoBarDelegate::GetMessageText() const { | 71 base::string16 FullscreenInfoBarDelegate::GetMessageText() const { |
| 68 Profile* profile = | 72 Profile* profile = |
| 69 ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); | 73 ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); |
| 70 std::string language = | 74 std::string language = |
| 71 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); | 75 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
| 72 return l10n_util::GetStringFUTF16( | 76 return l10n_util::GetStringFUTF16( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 88 Java_FullscreenInfoBarDelegate_onFullscreenAllowed( | 92 Java_FullscreenInfoBarDelegate_onFullscreenAllowed( |
| 89 env, j_delegate_.obj(), j_origin.obj()); | 93 env, j_delegate_.obj(), j_origin.obj()); |
| 90 return true; | 94 return true; |
| 91 } | 95 } |
| 92 | 96 |
| 93 bool FullscreenInfoBarDelegate::Cancel() { | 97 bool FullscreenInfoBarDelegate::Cancel() { |
| 94 Java_FullscreenInfoBarDelegate_onFullscreenCancelled( | 98 Java_FullscreenInfoBarDelegate_onFullscreenCancelled( |
| 95 base::android::AttachCurrentThread(), j_delegate_.obj()); | 99 base::android::AttachCurrentThread(), j_delegate_.obj()); |
| 96 return true; | 100 return true; |
| 97 } | 101 } |
| OLD | NEW |