Commit de774d83 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Remove some uses of deprecated_is_app.

Replace with is_type_app, is_type_app_popup, is_type_devtools as
appropriate.

Bug: 990158
Change-Id: I4df1b675ebec3408f690da7899653e00b851c388
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401263
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807075}
parent 3f7635bc
......@@ -499,10 +499,10 @@ void Navigate(NavigateParams* params) {
return;
// Trying to open a background tab when in an app browser results in
// focusing a regular browser window an opening a tab in the background
// focusing a regular browser window and opening a tab in the background
// of that window. Change the disposition to NEW_FOREGROUND_TAB so that
// the new tab is focused.
if (source_browser && source_browser->deprecated_is_app() &&
if (source_browser && source_browser->is_type_app() &&
params->disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB) {
params->disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
}
......
......@@ -58,7 +58,7 @@ class WindowPlacementPrefUpdate : public DictionaryPrefUpdate {
base::DictionaryValue* Get() override {
base::DictionaryValue* all_apps_dict = DictionaryPrefUpdate::Get();
base::DictionaryValue* this_app_dict_weak = NULL;
base::DictionaryValue* this_app_dict_weak = nullptr;
if (!all_apps_dict->GetDictionary(window_name_, &this_app_dict_weak)) {
auto this_app_dict = std::make_unique<base::DictionaryValue>();
this_app_dict_weak = this_app_dict.get();
......@@ -114,8 +114,8 @@ const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly(
const base::DictionaryValue* app_windows =
prefs->GetDictionary(prefs::kAppWindowPlacement);
if (!app_windows)
return NULL;
const base::DictionaryValue* to_return = NULL;
return nullptr;
const base::DictionaryValue* to_return = nullptr;
app_windows->GetDictionary(window_name, &to_return);
return to_return;
}
......@@ -131,10 +131,7 @@ bool SavedBoundsAreContentBounds(const Browser* browser) {
// Applications other than web apps (such as devtools) save their window size.
// Web apps, on the other hand, have the same behavior as popups, and save
// their content bounds.
bool is_app_with_window_bounds =
browser->deprecated_is_app() &&
!web_app::AppBrowserController::IsForWebAppBrowser(browser);
return !browser->is_type_normal() && !is_app_with_window_bounds &&
return !browser->is_type_normal() && !browser->is_type_devtools() &&
!browser->is_trusted_source();
}
......
......@@ -144,8 +144,8 @@ void UMABrowsingActivityObserver::LogBrowserTabCount() const {
browser->tab_strip_model()->count(), 1, 200,
50);
}
if (browser->deprecated_is_app())
if (browser->is_type_app() || browser->is_type_app_popup() ||
browser->is_type_devtools())
app_window_count++;
else if (browser->is_type_popup())
popup_window_count++;
......
......@@ -51,13 +51,14 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() {
// Set the app user model id for this application to that of the application
// name. See http://crbug.com/7028.
base::string16 app_id =
browser->deprecated_is_app()
browser->is_type_app() || browser->is_type_app_popup() ||
browser->is_type_devtools()
? shell_integration::win::GetAppUserModelIdForApp(
base::UTF8ToWide(browser->app_name()), profile->GetPath())
: shell_integration::win::GetAppUserModelIdForBrowser(
profile->GetPath());
// Apps set their relaunch details based on app's details.
if (browser->deprecated_is_app()) {
if (browser->is_type_app() || browser->is_type_app_popup()) {
ExtensionRegistry* registry = ExtensionRegistry::Get(profile);
const extensions::Extension* extension = registry->GetExtensionById(
web_app::GetAppIdFromApplicationName(browser->app_name()),
......@@ -77,9 +78,9 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() {
base::FilePath icon_path;
base::string16 command_line_string;
base::string16 pinned_name;
if (!browser->deprecated_is_app() && shortcut_manager &&
if ((browser->is_type_normal() || browser->is_type_popup()) &&
shortcut_manager &&
profile->GetPrefs()->HasPrefPath(prefs::kProfileIconVersion)) {
// Set relaunch details to use profile.
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
shortcut_manager->GetShortcutProperties(profile->GetPath(), &command_line,
......
......@@ -930,9 +930,7 @@ void ToolbarView::OnShowHomeButtonChanged() {
}
void ToolbarView::UpdateHomeButtonVisibility() {
const bool show_home_button =
show_home_button_.GetValue() || browser_->deprecated_is_app();
home_->SetVisible(show_home_button);
home_->SetVisible(show_home_button_.GetValue());
}
void ToolbarView::OnTouchUiChanged() {
......
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