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.chrome.browser.media.remote; | 5 package org.chromium.chrome.browser.media.remote; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 /** | 66 /** |
67 * A dialog fragment for choosing a media route that saves system visibility
for handling | 67 * A dialog fragment for choosing a media route that saves system visibility
for handling |
68 * fullscreen state of Chrome correctly. Needs to be a named public static c
lass, see | 68 * fullscreen state of Chrome correctly. Needs to be a named public static c
lass, see |
69 * https://crbug.com/618993. | 69 * https://crbug.com/618993. |
70 */ | 70 */ |
71 public static final class Fragment extends MediaRouteChooserDialogFragment { | 71 public static final class Fragment extends MediaRouteChooserDialogFragment { |
72 final Handler mHandler = new Handler(); | 72 final Handler mHandler = new Handler(); |
73 final MediaRouteController mController; | 73 final MediaRouteController mController; |
74 final MediaStateListener mPlayer; | 74 final MediaStateListener mPlayer; |
75 final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver
(); | 75 final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver
(); |
76 boolean mCancelled = false; | 76 boolean mCancelled; |
77 Context mContext = null; | 77 Context mContext; |
78 | 78 |
79 // The class has to be a public static class with a zero-argument constr
uctor. | 79 // The class has to be a public static class with a zero-argument constr
uctor. |
80 // Since we can't pass any callbacks to the fragment easily, just close
the dialog. | 80 // Since we can't pass any callbacks to the fragment easily, just close
the dialog. |
81 // See https://crbug.com/618993. | 81 // See https://crbug.com/618993. |
82 public Fragment() { | 82 public Fragment() { |
83 mHandler.post(new Runnable() { | 83 mHandler.post(new Runnable() { |
84 @Override | 84 @Override |
85 public void run() { | 85 public void run() { |
86 Fragment.this.dismiss(); | 86 Fragment.this.dismiss(); |
87 } | 87 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 mController.onRouteSelected(mPlayer, router, router.getSelectedR
oute()); | 131 mController.onRouteSelected(mPlayer, router, router.getSelectedR
oute()); |
132 } | 132 } |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 @Override | 136 @Override |
137 public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() { | 137 public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() { |
138 return new Fragment(mController, mPlayer); | 138 return new Fragment(mController, mPlayer); |
139 } | 139 } |
140 } | 140 } |
OLD | NEW |