OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.website; | 5 package org.chromium.chrome.browser.preferences.website; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 private Button mClearUnimportantButton; | 66 private Button mClearUnimportantButton; |
67 private Button mManageSiteDataButton; | 67 private Button mManageSiteDataButton; |
68 private Button mClearAllDataButton; | 68 private Button mClearAllDataButton; |
69 // Stored for testing. | 69 // Stored for testing. |
70 private AlertDialog mUnimportantDialog; | 70 private AlertDialog mUnimportantDialog; |
71 | 71 |
72 private static boolean sActivityNotExportedChecked; | 72 private static boolean sActivityNotExportedChecked; |
73 | 73 |
74 private boolean mIsNativeInitialized; | 74 private boolean mIsNativeInitialized; |
75 | 75 |
76 @SuppressLint("CommitPrefEdits") | 76 // TODO(crbug.com/635567): Fix this properly. |
Ted C
2017/04/27 19:02:47
Remove, this is doing the right thing comments why
F
2017/04/28 18:25:15
Done.
| |
77 @SuppressLint({"ApplySharedPref", "CommitPrefEdits"}) | |
77 @Override | 78 @Override |
78 protected void onCreate(Bundle savedInstanceState) { | 79 protected void onCreate(Bundle savedInstanceState) { |
79 ensureActivityNotExported(); | 80 ensureActivityNotExported(); |
80 | 81 |
81 setContentView(R.layout.manage_space_activity); | 82 setContentView(R.layout.manage_space_activity); |
82 Resources r = getResources(); | 83 Resources r = getResources(); |
83 setTitle(String.format(r.getString(R.string.storage_management_activity_ label), | 84 setTitle(String.format(r.getString(R.string.storage_management_activity_ label), |
84 r.getString(R.string.app_name))); | 85 r.getString(R.string.app_name))); |
85 | 86 |
86 mSiteDataSizeText = (TextView) findViewById(R.id.site_data_storage_size_ text); | 87 mSiteDataSizeText = (TextView) findViewById(R.id.site_data_storage_size_ text); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC omponentName(), 0); | 344 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC omponentName(), 0); |
344 if (activityInfo.exported) { | 345 if (activityInfo.exported) { |
345 throw new IllegalStateException("ManageSpaceActivity must not be exported."); | 346 throw new IllegalStateException("ManageSpaceActivity must not be exported."); |
346 } | 347 } |
347 } catch (NameNotFoundException ex) { | 348 } catch (NameNotFoundException ex) { |
348 // Something terribly wrong has happened. | 349 // Something terribly wrong has happened. |
349 throw new RuntimeException(ex); | 350 throw new RuntimeException(ex); |
350 } | 351 } |
351 } | 352 } |
352 } | 353 } |
OLD | NEW |