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

Side by Side Diff: chrome/browser/android/fullscreen/fullscreen_infobar_delegate.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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
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 infobars::InfoBarDelegate::InfoBarIdentifier
64 FullscreenInfoBarDelegate::GetIdentifier() const {
65 return FULLSCREEN_INFOBAR_DELEGATE;
66 }
67
63 int FullscreenInfoBarDelegate::GetIconId() const { 68 int FullscreenInfoBarDelegate::GetIconId() const {
64 return IDR_ANDROID_INFOBAR_FULLSCREEN; 69 return IDR_ANDROID_INFOBAR_FULLSCREEN;
65 } 70 }
66 71
67 base::string16 FullscreenInfoBarDelegate::GetMessageText() const { 72 base::string16 FullscreenInfoBarDelegate::GetMessageText() const {
68 Profile* profile = 73 Profile* profile =
69 ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); 74 ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
70 std::string language = 75 std::string language =
71 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 76 profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
72 return l10n_util::GetStringFUTF16( 77 return l10n_util::GetStringFUTF16(
(...skipping 15 matching lines...) Expand all
88 Java_FullscreenInfoBarDelegate_onFullscreenAllowed( 93 Java_FullscreenInfoBarDelegate_onFullscreenAllowed(
89 env, j_delegate_.obj(), j_origin.obj()); 94 env, j_delegate_.obj(), j_origin.obj());
90 return true; 95 return true;
91 } 96 }
92 97
93 bool FullscreenInfoBarDelegate::Cancel() { 98 bool FullscreenInfoBarDelegate::Cancel() {
94 Java_FullscreenInfoBarDelegate_onFullscreenCancelled( 99 Java_FullscreenInfoBarDelegate_onFullscreenCancelled(
95 base::android::AttachCurrentThread(), j_delegate_.obj()); 100 base::android::AttachCurrentThread(), j_delegate_.obj());
96 return true; 101 return true;
97 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698