Commit 99539c09 authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Replace deprecated getLastUsedProfile function in LocationBarModel.

|Profile#getLastUsedProfile| is deprecated and replaced with
|Profile#getLastUsedRegularProfile|. This CL updates LocationBarModel
class.

Note: This change is only code clean-up, does not change any behavior.

Bug: 1041781
Change-Id: Id9a6647395aac65bafd543529215fa827e5b1869
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067070Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746004}
parent 99b94466
......@@ -289,15 +289,16 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope
@Override
public Profile getProfile() {
Profile lastUsedProfile = Profile.getLastUsedProfile();
Profile lastUsedRegularProfile = Profile.getLastUsedRegularProfile();
if (mIsIncognito) {
// When in overview mode with no open tabs, there has not been created an
// OffTheRecordProfile yet. #getOffTheRecordProfile will create a profile if none
// exists.
assert lastUsedProfile.hasOffTheRecordProfile() || isInOverviewAndShowingOmnibox();
return lastUsedProfile.getOffTheRecordProfile();
assert lastUsedRegularProfile.hasOffTheRecordProfile()
|| isInOverviewAndShowingOmnibox();
return lastUsedRegularProfile.getOffTheRecordProfile();
}
return lastUsedProfile.getOriginalProfile();
return lastUsedRegularProfile;
}
public void setOverviewModeBehavior(OverviewModeBehavior overviewModeBehavior) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment