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.router; | 5 package org.chromium.chrome.browser.media.router; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.DialogInterface; | 8 import android.content.DialogInterface; |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.support.v4.app.DialogFragment; | 10 import android.support.v4.app.DialogFragment; |
(...skipping 16 matching lines...) Expand all Loading... |
27 MediaRouteDialogDelegate delegate) { | 27 MediaRouteDialogDelegate delegate) { |
28 super(source, applicationContext, delegate); | 28 super(source, applicationContext, delegate); |
29 } | 29 } |
30 | 30 |
31 /** | 31 /** |
32 * Fragment implementation for MediaRouteChooserDialogManager. | 32 * Fragment implementation for MediaRouteChooserDialogManager. |
33 */ | 33 */ |
34 public static class Fragment extends MediaRouteChooserDialogFragment { | 34 public static class Fragment extends MediaRouteChooserDialogFragment { |
35 private final Handler mHandler = new Handler(); | 35 private final Handler mHandler = new Handler(); |
36 private final SystemVisibilitySaver mVisibilitySaver = new SystemVisibil
itySaver(); | 36 private final SystemVisibilitySaver mVisibilitySaver = new SystemVisibil
itySaver(); |
37 private BaseMediaRouteDialogManager mManager = null; | 37 private BaseMediaRouteDialogManager mManager; |
38 private boolean mCancelled; | 38 private boolean mCancelled; |
39 | 39 |
40 public Fragment() { | 40 public Fragment() { |
41 mHandler.post(new Runnable() { | 41 mHandler.post(new Runnable() { |
42 @Override | 42 @Override |
43 public void run() { | 43 public void run() { |
44 Fragment.this.dismiss(); | 44 Fragment.this.dismiss(); |
45 } | 45 } |
46 }); | 46 }); |
47 } | 47 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 MediaRouteSelector selector = mediaSource().buildRouteSelector(); | 94 MediaRouteSelector selector = mediaSource().buildRouteSelector(); |
95 if (selector == null) return null; | 95 if (selector == null) return null; |
96 | 96 |
97 fragment.setRouteSelector(selector); | 97 fragment.setRouteSelector(selector); |
98 fragment.show(fm, DIALOG_FRAGMENT_TAG); | 98 fragment.show(fm, DIALOG_FRAGMENT_TAG); |
99 fm.executePendingTransactions(); | 99 fm.executePendingTransactions(); |
100 | 100 |
101 return fragment; | 101 return fragment; |
102 } | 102 } |
103 } | 103 } |
OLD | NEW |