OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Color; | 8 import android.graphics.Color; |
9 import android.view.KeyEvent; | 9 import android.view.KeyEvent; |
10 import android.view.MotionEvent; | 10 import android.view.MotionEvent; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP | 120 } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP |
121 || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) { | 121 || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) { |
122 if (isPlaying()) { | 122 if (isPlaying()) { |
123 pause(); | 123 pause(); |
124 mMediaController.show(); | 124 mMediaController.show(); |
125 } | 125 } |
126 return true; | 126 return true; |
127 } else { | 127 } else { |
128 toggleMediaControlsVisiblity(); | 128 toggleMediaControlsVisiblity(); |
129 } | 129 } |
130 } else if (keyCode == KeyEvent.KEYCODE_BACK && | 130 } else if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEv ent.KEYCODE_ESCAPE) |
131 event.getAction() == KeyEvent.ACTION_UP) { | 131 && event.getAction() == KeyEvent.ACTION_UP) { |
Ted C
2014/09/02 16:28:56
+4 indent
divya.bansal
2014/09/03 04:42:23
Done.
| |
132 exitFullscreen(false); | 132 exitFullscreen(false); |
133 return true; | 133 return true; |
134 } else if (keyCode == KeyEvent.KEYCODE_MENU || keyCode == KeyEve nt.KEYCODE_SEARCH) { | 134 } else if (keyCode == KeyEvent.KEYCODE_MENU || keyCode == KeyEve nt.KEYCODE_SEARCH) { |
135 return true; | 135 return true; |
136 } | 136 } |
137 return false; | 137 return false; |
138 } | 138 } |
139 }); | 139 }); |
140 setOnTouchListener(new OnTouchListener() { | 140 setOnTouchListener(new OnTouchListener() { |
141 @Override | 141 @Override |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 /** | 293 /** |
294 * Sets the MediaControlsVisibilityListener that wants to listen to visibili ty change events. | 294 * Sets the MediaControlsVisibilityListener that wants to listen to visibili ty change events. |
295 * | 295 * |
296 * @param listener the listener to send the events to. | 296 * @param listener the listener to send the events to. |
297 */ | 297 */ |
298 public void setListener(MediaControlsVisibilityListener listener) { | 298 public void setListener(MediaControlsVisibilityListener listener) { |
299 mListener = listener; | 299 mListener = listener; |
300 } | 300 } |
301 | 301 |
302 } | 302 } |
OLD | NEW |