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; | 5 package org.chromium.chrome.browser; |
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.Activity; | 9 import android.app.Activity; |
10 import android.app.SearchManager; | 10 import android.app.SearchManager; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 /** | 444 /** |
445 * @return Whether contextual search is allowed for this activity or not. | 445 * @return Whether contextual search is allowed for this activity or not. |
446 */ | 446 */ |
447 protected boolean isContextualSearchAllowed() { | 447 protected boolean isContextualSearchAllowed() { |
448 return true; | 448 return true; |
449 } | 449 } |
450 | 450 |
451 @Override | 451 @Override |
452 public void initializeState() { | 452 public void initializeState() { |
453 super.initializeState(); | 453 super.initializeState(); |
| 454 mBlimpClientContextDelegate = |
| 455 ChromeBlimpClientContextDelegate.createAndSetDelegateForContext( |
| 456 Profile.getLastUsedProfile().getOriginalProfile()); |
| 457 |
454 IntentHandler.setTestIntentsEnabled( | 458 IntentHandler.setTestIntentsEnabled( |
455 CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_
INTENTS)); | 459 CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_
INTENTS)); |
456 mIntentHandler = new IntentHandler(createIntentHandlerDelegate(), getPac
kageName()); | 460 mIntentHandler = new IntentHandler(createIntentHandlerDelegate(), getPac
kageName()); |
457 } | 461 } |
458 | 462 |
459 @Override | 463 @Override |
460 public void initializeCompositor() { | 464 public void initializeCompositor() { |
461 TraceEvent.begin("ChromeActivity:CompositorInitialization"); | 465 TraceEvent.begin("ChromeActivity:CompositorInitialization"); |
462 super.initializeCompositor(); | 466 super.initializeCompositor(); |
463 | 467 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.
VERSION_CODES.M) { | 942 if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.
VERSION_CODES.M) { |
939 getWindow().setBackgroundDrawable(new ColorDrawable( | 943 getWindow().setBackgroundDrawable(new ColorDrawable( |
940 ApiCompatibilityUtils.getColor(getResources(), | 944 ApiCompatibilityUtils.getColor(getResources(), |
941 R.color.resizing_background_color))); | 945 R.color.resizing_background_color))); |
942 } else { | 946 } else { |
943 removeWindowBackground(); | 947 removeWindowBackground(); |
944 } | 948 } |
945 DownloadManagerService.getDownloadManagerService( | 949 DownloadManagerService.getDownloadManagerService( |
946 getApplicationContext()).onActivityLaunched(); | 950 getApplicationContext()).onActivityLaunched(); |
947 | 951 |
948 mBlimpClientContextDelegate = ChromeBlimpClientContextDelegate | |
949 .createAndSetDelegateForContext(Profile.getLastUsedProfile().get
OriginalProfile()); | |
950 | |
951 super.finishNativeInitialization(); | 952 super.finishNativeInitialization(); |
952 } | 953 } |
953 | 954 |
954 /** | 955 /** |
955 * Called when the accessibility status of this device changes. This might
be triggered by | 956 * Called when the accessibility status of this device changes. This might
be triggered by |
956 * touch exploration or general accessibility status updates. It is an aggr
egate of two other | 957 * touch exploration or general accessibility status updates. It is an aggr
egate of two other |
957 * accessibility update methods. | 958 * accessibility update methods. |
958 * @see #onAccessibilityModeChanged(boolean) | 959 * @see #onAccessibilityModeChanged(boolean) |
959 * @see #onTouchExplorationStateChanged(boolean) | 960 * @see #onTouchExplorationStateChanged(boolean) |
960 * @param enabled Whether or not accessibility and touch exploration are cur
rently enabled. | 961 * @param enabled Whether or not accessibility and touch exploration are cur
rently enabled. |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", | 1766 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", |
1766 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); | 1767 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); |
1767 | 1768 |
1768 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { | 1769 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { |
1769 RecordHistogram.recordLinearCountHistogram( | 1770 RecordHistogram.recordLinearCountHistogram( |
1770 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, | 1771 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, |
1771 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); | 1772 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); |
1772 } | 1773 } |
1773 } | 1774 } |
1774 } | 1775 } |
OLD | NEW |