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 package org.chromium.chrome.browser.media.ui; | 5 package org.chromium.chrome.browser.media.ui; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.media.AudioManager; | 10 import android.media.AudioManager; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 mNotificationInfoBuilder = | 122 mNotificationInfoBuilder = |
123 new MediaNotificationInfo.Builder() | 123 new MediaNotificationInfo.Builder() |
124 .setMetadata(metadata) | 124 .setMetadata(metadata) |
125 .setPaused(isPaused) | 125 .setPaused(isPaused) |
126 .setOrigin(mOrigin) | 126 .setOrigin(mOrigin) |
127 .setTabId(mTab.getId()) | 127 .setTabId(mTab.getId()) |
128 .setPrivate(mTab.isIncognito()) | 128 .setPrivate(mTab.isIncognito()) |
129 .setIcon(R.drawable.audio_playing) | 129 .setIcon(R.drawable.audio_playing) |
130 .setLargeIcon(mFavicon) | 130 .setLargeIcon(mFavicon) |
| 131 .setDefaultLargeIcon(R.drawable.audio_playing_sq
uare) |
131 .setActions(MediaNotificationInfo.ACTION_PLAY_PA
USE | 132 .setActions(MediaNotificationInfo.ACTION_PLAY_PA
USE |
132 | MediaNotificationInfo.ACTION_SWIPEAWAY
) | 133 | MediaNotificationInfo.ACTION_SWIPEAWAY
) |
133 .setContentIntent(contentIntent) | 134 .setContentIntent(contentIntent) |
134 .setId(R.id.media_playback_notification) | 135 .setId(R.id.media_playback_notification) |
135 .setListener(mControlsListener); | 136 .setListener(mControlsListener); |
136 | 137 |
137 MediaNotificationManager.show(ContextUtils.getApplicationContext
(), | 138 MediaNotificationManager.show(ContextUtils.getApplicationContext
(), |
138 mNotificationInfoBuilder.build()); | 139 mNotificationInfoBuilder.build()); |
139 | 140 |
140 Activity activity = getActivityFromTab(mTab); | 141 Activity activity = getActivityFromTab(mTab); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 return false; | 301 return false; |
301 } | 302 } |
302 if (mFavicon != null && (icon.getWidth() < mFavicon.getWidth() | 303 if (mFavicon != null && (icon.getWidth() < mFavicon.getWidth() |
303 || icon.getHeight() < mFavicon.getHeight
())) { | 304 || icon.getHeight() < mFavicon.getHeight
())) { |
304 return false; | 305 return false; |
305 } | 306 } |
306 mFavicon = icon; | 307 mFavicon = icon; |
307 return true; | 308 return true; |
308 } | 309 } |
309 } | 310 } |
OLD | NEW |