| 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.preferences; | 5 package org.chromium.chrome.browser.preferences; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.app.ActivityManager.AppTask; | 9 import android.app.ActivityManager.AppTask; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 }) | 78 }) |
| 79 .setPositiveButton(R.string.ok, new DialogInterface.OnClickListe
ner() { | 79 .setPositiveButton(R.string.ok, new DialogInterface.OnClickListe
ner() { |
| 80 @Override | 80 @Override |
| 81 public void onClick(DialogInterface dialog, int which) { | 81 public void onClick(DialogInterface dialog, int which) { |
| 82 dialog.dismiss(); | 82 dialog.dismiss(); |
| 83 if (optOut) { | 83 if (optOut) { |
| 84 RecordUserAction.record("DocumentActivity_UserOptOut
"); | 84 RecordUserAction.record("DocumentActivity_UserOptOut
"); |
| 85 } else { | 85 } else { |
| 86 RecordUserAction.record("DocumentActivity_UserOptIn"
); | 86 RecordUserAction.record("DocumentActivity_UserOptIn"
); |
| 87 } | 87 } |
| 88 mDocumentModeManager.setOptedOutState(optOut | |
| 89 ? DocumentModeManager.OPT_OUT_PROMO_DISMISSED | |
| 90 : DocumentModeManager.OPTED_OUT_OF_DOCUMENT_MODE
); | |
| 91 mDocumentModeManager.setOptOutCleanUpPending(true); | |
| 92 DocumentMigrationHelper.migrateTabs( | 88 DocumentMigrationHelper.migrateTabs( |
| 93 optOut, getActivity(), isRestartNeeded(optOut)); | 89 optOut, getActivity(), isRestartNeeded(optOut)); |
| 94 } | 90 } |
| 95 }) | 91 }) |
| 96 .setOnCancelListener(new DialogInterface.OnCancelListener() { | 92 .setOnCancelListener(new DialogInterface.OnCancelListener() { |
| 97 @Override | 93 @Override |
| 98 public void onCancel(DialogInterface dialog) { | 94 public void onCancel(DialogInterface dialog) { |
| 99 mDocumentModeSwitch.setChecked(isSwitchEnabled); | 95 mDocumentModeSwitch.setChecked(isSwitchEnabled); |
| 100 } | 96 } |
| 101 }) | 97 }) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 126 | 122 |
| 127 for (int i = 0; i < taskList.size(); i++) { | 123 for (int i = 0; i < taskList.size(); i++) { |
| 128 String className = DocumentUtils.getTaskClassName(taskList.get(i), p
m); | 124 String className = DocumentUtils.getTaskClassName(taskList.get(i), p
m); |
| 129 if (className == null) continue; | 125 if (className == null) continue; |
| 130 if (DocumentActivity.isDocumentActivity(className)) return true; | 126 if (DocumentActivity.isDocumentActivity(className)) return true; |
| 131 } | 127 } |
| 132 return false; | 128 return false; |
| 133 } | 129 } |
| 134 | 130 |
| 135 } | 131 } |
| OLD | NEW |