diff --git a/chrome/browser/apps/app_service/app_icon/app_icon_factory.cc b/chrome/browser/apps/app_service/app_icon/app_icon_factory.cc index 7dbf1453d7f58..ca31815526579 100644 --- a/chrome/browser/apps/app_service/app_icon/app_icon_factory.cc +++ b/chrome/browser/apps/app_service/app_icon/app_icon_factory.cc @@ -320,8 +320,9 @@ gfx::ImageSkia LoadMaskImage(const ScaleToSize& scale_to_size) { gfx::ImageSkia ApplyBackgroundAndMask(const gfx::ImageSkia& image) { TRACE_EVENT0("ui", "apps::ApplyBackgroundAndMask"); - if (image.isNull()) + if (image.isNull()) { return gfx::ImageSkia(); + } return gfx::ImageSkiaOperations::CreateButtonBackground( SK_ColorWHITE, image, LoadMaskImage(GetScaleToSize(image))); } diff --git a/chrome/browser/apps/app_service/app_icon/app_icon_loader.cc b/chrome/browser/apps/app_service/app_icon/app_icon_loader.cc index 8f88605bd4d7b..0b78d7a4cdd11 100644 --- a/chrome/browser/apps/app_service/app_icon/app_icon_loader.cc +++ b/chrome/browser/apps/app_service/app_icon/app_icon_loader.cc @@ -392,8 +392,9 @@ void AppIconLoader::ApplyIconEffects(IconEffects icon_effects, const std::optional<std::string>& app_id, IconValuePtr iv) { TRACE_EVENT0("ui", "AppIconLoader::ApplyIconEffects"); - if (!iv || iv->uncompressed.isNull()) + if (!iv || iv->uncompressed.isNull()) { return; + } if (!standard_icon_task_runner_) { standard_icon_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( diff --git a/chrome/browser/apps/app_service/app_icon/app_icon_source.cc b/chrome/browser/apps/app_service/app_icon/app_icon_source.cc index f942ab44040ba..c878d06a372c4 100644 --- a/chrome/browser/apps/app_service/app_icon/app_icon_source.cc +++ b/chrome/browser/apps/app_service/app_icon/app_icon_source.cc @@ -85,8 +85,9 @@ void AppIconSource::StartDataRequest( // Check whether data is of correct type, load default image if not. std::string size_param = base::ToLowerASCII(path_parts[1]); size_t query_position = size_param.find("?"); - if (query_position != std::string::npos) + if (query_position != std::string::npos) { size_param = size_param.substr(0, query_position); + } int size_in_dip = 0; if (!base::StringToInt(size_param, &size_in_dip) || size_in_dip < 1) { LoadDefaultImage(std::move(callback)); diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.cc b/chrome/browser/apps/app_service/app_service_proxy_ash.cc index 49a0343aace5f..533577712b952 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.cc @@ -500,8 +500,9 @@ void AppServiceProxyAsh::LaunchAppWithIntent(const std::string& app_id, files_controller->CheckIfLaunchAllowed(update, std::move(intent_copy), std::move(launch_callback)); }); - if (!app_found) + if (!app_found) { std::move(launch_callback).Run(/*is_allowed=*/true); + } } else { std::move(launch_callback).Run(/*is_allowed=*/true); } @@ -1203,8 +1204,9 @@ bool AppServiceProxyAsh::CanRunLaunchCallback( InstanceRegistry().ForOneInstance( instance_id, [&exists](const apps::InstanceUpdate& update) { exists = true; }); - if (!exists) + if (!exists) { return false; + } } return true; diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.cc b/chrome/browser/apps/app_service/app_service_proxy_base.cc index 7a984b86a3bb1..0517c70f8008e 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_base.cc @@ -345,44 +345,43 @@ void AppServiceProxyBase::LaunchAppWithIntent(const std::string& app_id, WindowInfoPtr window_info, LaunchCallback callback) { CHECK(intent); - app_registry_cache_.ForOneApp( - app_id, - [this, event_flags, &intent, launch_source, &window_info, - callback = std::move(callback)](const AppUpdate& update) mutable { - auto* publisher = GetPublisher(update.AppType()); - if (!publisher) { - std::unique_ptr<LaunchParams> params = - std::make_unique<LaunchParams>(); - params->event_flags_ = event_flags; - params->intent_ = std::move(intent); - params->launch_source_ = launch_source; - params->window_info_ = std::move(window_info); - params->call_back_ = std::move(callback); - OnPublisherNotReadyForLaunch(update.AppId(), std::move(params)); - return; - } + app_registry_cache_.ForOneApp(app_id, [this, event_flags, &intent, + launch_source, &window_info, + callback = std::move(callback)]( + const AppUpdate& update) mutable { + auto* publisher = GetPublisher(update.AppType()); + if (!publisher) { + std::unique_ptr<LaunchParams> params = std::make_unique<LaunchParams>(); + params->event_flags_ = event_flags; + params->intent_ = std::move(intent); + params->launch_source_ = launch_source; + params->window_info_ = std::move(window_info); + params->call_back_ = std::move(callback); + OnPublisherNotReadyForLaunch(update.AppId(), std::move(params)); + return; + } - if (MaybeShowLaunchPreventionDialog(update)) { - std::move(callback).Run(LaunchResult(State::FAILED)); - return; - } + if (MaybeShowLaunchPreventionDialog(update)) { + std::move(callback).Run(LaunchResult(State::FAILED)); + return; + } - // TODO(crbug/1117655): File manager records metrics for apps it - // launched. So we only record launches from other places. We should - // eventually move those metrics here, after AppService supports all - // app types launched by file manager. - if (launch_source != LaunchSource::kFromFileManager) { - RecordAppLaunch(update.AppId(), launch_source); - } - RecordAppPlatformMetrics(profile_, update, launch_source, - LaunchContainer::kLaunchContainerNone); + // TODO(crbug/1117655): File manager records metrics for apps it + // launched. So we only record launches from other places. We should + // eventually move those metrics here, after AppService supports all + // app types launched by file manager. + if (launch_source != LaunchSource::kFromFileManager) { + RecordAppLaunch(update.AppId(), launch_source); + } + RecordAppPlatformMetrics(profile_, update, launch_source, + LaunchContainer::kLaunchContainerNone); - publisher->LaunchAppWithIntent( - update.AppId(), event_flags, std::move(intent), launch_source, - std::move(window_info), std::move(callback)); + publisher->LaunchAppWithIntent(update.AppId(), event_flags, + std::move(intent), launch_source, + std::move(window_info), std::move(callback)); - PerformPostLaunchTasks(launch_source); - }); + PerformPostLaunchTasks(launch_source); + }); } void AppServiceProxyBase::LaunchAppWithUrl(const std::string& app_id, diff --git a/chrome/browser/apps/app_service/app_service_test.cc b/chrome/browser/apps/app_service/app_service_test.cc index bae6728f17d54..8670c9d97e9f2 100644 --- a/chrome/browser/apps/app_service/app_service_test.cc +++ b/chrome/browser/apps/app_service/app_service_test.cc @@ -45,8 +45,9 @@ void AppServiceTest::UninstallAllApps(Profile* profile) { std::string AppServiceTest::GetAppName(const std::string& app_id) const { std::string name; - if (!app_service_proxy_) + if (!app_service_proxy_) { return name; + } app_service_proxy_->AppRegistryCache().ForOneApp( app_id, [&name](const AppUpdate& update) { name = update.Name(); }); return name; diff --git a/chrome/browser/apps/app_service/browser_app_instance_tracker.cc b/chrome/browser/apps/app_service/browser_app_instance_tracker.cc index f8cb4c5189e64..f171d19355b41 100644 --- a/chrome/browser/apps/app_service/browser_app_instance_tracker.cc +++ b/chrome/browser/apps/app_service/browser_app_instance_tracker.cc @@ -61,8 +61,9 @@ bool HaveSameWindowTreeHostLacros(aura::Window* window1, Browser* GetBrowserWithTabStripModel(TabStripModel* tab_strip_model) { for (auto* browser : *BrowserList::GetInstance()) { - if (browser->tab_strip_model() == tab_strip_model) + if (browser->tab_strip_model() == tab_strip_model) { return browser; + } } return nullptr; } @@ -122,8 +123,9 @@ std::string GetAppIdForBrowser(Browser* browser) { auto* registry = extensions::ExtensionRegistry::Get(browser->profile()); auto* extension = registry->GetInstalledExtension(app_id); // This is a web-app. - if (!extension) + if (!extension) { return app_id; + } if (extension->is_hosted_app() || extension->is_legacy_packaged_app()) { return app_id; diff --git a/chrome/browser/apps/app_service/browser_app_instance_tracker_browsertest.cc b/chrome/browser/apps/app_service/browser_app_instance_tracker_browsertest.cc index 606472069652c..cfc32d21685f5 100644 --- a/chrome/browser/apps/app_service/browser_app_instance_tracker_browsertest.cc +++ b/chrome/browser/apps/app_service/browser_app_instance_tracker_browsertest.cc @@ -117,8 +117,7 @@ struct TestInstance { bool operator==(const TestInstance& e1, const TestInstance& e2) { return e1.name == e2.name && e1.id == e2.id && e1.type == e2.type && e1.app_id == e2.app_id && e1.window == e2.window && - e1.title == e2.title && - e1.is_browser_active == e2.is_browser_active && + e1.title == e2.title && e1.is_browser_active == e2.is_browser_active && e1.is_web_contents_active == e2.is_web_contents_active; } diff --git a/chrome/browser/apps/app_service/extension_apps_utils.cc b/chrome/browser/apps/app_service/extension_apps_utils.cc index 16566540bfc97..fa00a77cb89c3 100644 --- a/chrome/browser/apps/app_service/extension_apps_utils.cc +++ b/chrome/browser/apps/app_service/extension_apps_utils.cc @@ -29,8 +29,9 @@ namespace apps { #if BUILDFLAG(IS_CHROMEOS_LACROS) bool ShouldHostedAppsRunInLacros() { - if (g_enable_hosted_apps_in_lacros_for_testing) + if (g_enable_hosted_apps_in_lacros_for_testing) { return true; + } return chromeos::BrowserParamsProxy::Get()->PublishHostedApps(); } diff --git a/chrome/browser/apps/app_service/intent_util.h b/chrome/browser/apps/app_service/intent_util.h index 93d60eb7ba8b7..f8322ddc44e17 100644 --- a/chrome/browser/apps/app_service/intent_util.h +++ b/chrome/browser/apps/app_service/intent_util.h @@ -25,7 +25,7 @@ namespace arc { class ArcIntentHelperBridge; class IntentFilter; -} +} // namespace arc #endif class Profile; diff --git a/chrome/browser/apps/app_service/launch_result_type.cc b/chrome/browser/apps/app_service/launch_result_type.cc index 2a2b7884f33d0..d3c4f06cce646 100644 --- a/chrome/browser/apps/app_service/launch_result_type.cc +++ b/chrome/browser/apps/app_service/launch_result_type.cc @@ -50,8 +50,9 @@ LaunchResult ConvertMojomLaunchResultToLaunchResult( crosapi::mojom::LaunchResultPtr mojom_launch_result) { auto launch_result = LaunchResult(); if (mojom_launch_result->instance_ids) { - for (auto token : *mojom_launch_result->instance_ids) + for (auto token : *mojom_launch_result->instance_ids) { launch_result.instance_ids.push_back(std::move(token)); + } } else { launch_result.instance_ids.push_back( std::move(mojom_launch_result->instance_id)); diff --git a/chrome/browser/apps/app_service/launch_utils.cc b/chrome/browser/apps/app_service/launch_utils.cc index f1acfa4cc8636..33fb1230ab229 100644 --- a/chrome/browser/apps/app_service/launch_utils.cc +++ b/chrome/browser/apps/app_service/launch_utils.cc @@ -170,12 +170,14 @@ std::vector<base::FilePath> GetLaunchFilesFromCommandLine( #else GURL url(arg); #endif - if (url.is_valid() && !url.SchemeIsFile()) + if (url.is_valid() && !url.SchemeIsFile()) { continue; + } base::FilePath path(arg); - if (path.empty()) + if (path.empty()) { continue; + } launch_files.push_back(path); } diff --git a/chrome/browser/apps/app_service/menu_util.cc b/chrome/browser/apps/app_service/menu_util.cc index efd37748b585a..c9a002b64b7b4 100644 --- a/chrome/browser/apps/app_service/menu_util.cc +++ b/chrome/browser/apps/app_service/menu_util.cc @@ -151,8 +151,9 @@ void PopulateLaunchNewItemFromMenuItem(const MenuItemPtr& menu_item, int* launch_new_string_id) { DCHECK_EQ(menu_item->command_id, ash::LAUNCH_NEW); - if (launch_new_string_id) + if (launch_new_string_id) { *launch_new_string_id = menu_item->string_id; + } switch (menu_item->type) { case apps::MenuItemType::kCommand: { @@ -210,10 +211,12 @@ base::StringPiece MenuTypeToString(MenuType menu_type) { } MenuType MenuTypeFromString(base::StringPiece menu_type) { - if (base::EqualsCaseInsensitiveASCII(menu_type, "shelf")) + if (base::EqualsCaseInsensitiveASCII(menu_type, "shelf")) { return MenuType::kShelf; - if (base::EqualsCaseInsensitiveASCII(menu_type, "applist")) + } + if (base::EqualsCaseInsensitiveASCII(menu_type, "applist")) { return MenuType::kAppList; + } return MenuType::kShelf; } diff --git a/chrome/browser/apps/app_service/notifications_browsertest.cc b/chrome/browser/apps/app_service/notifications_browsertest.cc index b7264eb253c74..59859783db6b7 100644 --- a/chrome/browser/apps/app_service/notifications_browsertest.cc +++ b/chrome/browser/apps/app_service/notifications_browsertest.cc @@ -174,8 +174,9 @@ class AppNotificationsExtensionApiTest : public extensions::ExtensionApiTest { std::set<std::string> notifications = GetDisplayHelper()->GetNotificationIdsForExtension(extension->url()); - if (notifications.size() != 1) + if (notifications.size() != 1) { return nullptr; + } return GetDisplayHelper()->GetByNotificationId(*notifications.begin()); } @@ -856,8 +857,9 @@ class AppNotificationsArcNotificationTest } void StopInstance() { - if (app_instance_) + if (app_instance_) { arc_bridge_service()->app()->CloseInstance(app_instance_.get()); + } arc_session_manager()->Shutdown(); } diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc index 383ac055dc342..8817f2687047f 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc +++ b/chrome/browser/apps/app_service/publishers/extension_apps_chromeos.cc @@ -783,8 +783,9 @@ bool ExtensionAppsChromeOs::IsBlocklisted(const std::string& app_id) { // In the App Service world, there should be a unique app publisher for any // given app. In this case, the ArcApps publisher publishes the Play Store // app, and the ExtensionApps publisher does not. - if (app_id == arc::kPlayStoreAppId) + if (app_id == arc::kPlayStoreAppId) { return true; + } // If lacros chrome apps is enabled, a small list of extension apps or // extensions on ash extension keeplist is allowed to run in both ash and diff --git a/chrome/browser/apps/app_service/publishers/guest_os_apps.cc b/chrome/browser/apps/app_service/publishers/guest_os_apps.cc index 9d26d468b373a..dbb59db0efbb0 100644 --- a/chrome/browser/apps/app_service/publishers/guest_os_apps.cc +++ b/chrome/browser/apps/app_service/publishers/guest_os_apps.cc @@ -233,7 +233,7 @@ apps::IntentFilters CreateIntentFilterForAppService( // them with a single "text/*" mime type. if (base::Contains(mime_types, "text/plain")) { base::EraseIf(mime_types, [](const std::string& s) { - return base::StartsWith(s, "text/"); + return base::StartsWith(s, "text/"); }); mime_types.push_back("text/*"); } diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc index 901fc9a4f3797..b5c78985b5871 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc @@ -92,8 +92,9 @@ AppPtr StandaloneBrowserApps::CreateStandaloneBrowserApp() { InstallSource::kSystem); app->short_name = short_name; - if (crosapi::browser_util::IsAshWebBrowserEnabled()) + if (crosapi::browser_util::IsAshWebBrowserEnabled()) { app->additional_search_terms.push_back("chrome"); + } app->icon_key = std::move(*CreateIconKey(/*is_browser_load_success=*/true)); app->searchable = true; @@ -110,8 +111,9 @@ AppPtr StandaloneBrowserApps::CreateStandaloneBrowserApp() { void StandaloneBrowserApps::Initialize() { auto* browser_manager = crosapi::BrowserManager::Get(); // |browser_manager| may be null in tests. For tests, assume Lacros is ready. - if (browser_manager && !observation_.IsObserving()) + if (browser_manager && !observation_.IsObserving()) { observation_.Observe(browser_manager); + } RegisterPublisher(AppType::kStandaloneBrowser); @@ -148,8 +150,9 @@ void StandaloneBrowserApps::GetMenuModel( void StandaloneBrowserApps::OpenNativeSettings(const std::string& app_id) { auto* browser_manager = crosapi::BrowserManager::Get(); // `browser_manager` may be null in tests. - if (!browser_manager) + if (!browser_manager) { return; + } browser_manager->SwitchToTab( chrome::GetSettingsUrl(chrome::kContentSettingsSubPage), /*path_behavior=*/NavigateParams::RESPECT); diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc index d3564acbd6802..fc49ce31e287f 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc @@ -36,8 +36,9 @@ namespace { // Returns true if app's launch info should be saved to full restore. bool ShouldSaveToFullRestore(AppServiceProxy* proxy, const std::string& app_id) { - if (!::full_restore::features::IsFullRestoreForLacrosEnabled()) + if (!::full_restore::features::IsFullRestoreForLacrosEnabled()) { return false; + } bool is_platform_app = true; proxy->AppRegistryCache().ForOneApp( @@ -99,8 +100,9 @@ void StandaloneBrowserExtensionApps::Launch(const std::string& app_id, WindowInfoPtr window_info) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } // The following code assumes |app_type_| must be // AppType::kStandaloneBrowserChromeApp. Therefore, the app must be either @@ -130,8 +132,9 @@ void StandaloneBrowserExtensionApps::LaunchAppWithFiles( std::vector<base::FilePath> file_paths) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } std::vector<base::FilePath> file_paths_for_restore = file_paths; auto launch_params = crosapi::mojom::LaunchParams::New(); @@ -213,8 +216,9 @@ void StandaloneBrowserExtensionApps::Uninstall(const std::string& app_id, bool report_abuse) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } controller_->Uninstall(app_id, uninstall_source, clear_site_data, report_abuse); @@ -271,8 +275,9 @@ void StandaloneBrowserExtensionApps::SetWindowMode(const std::string& app_id, WindowMode window_mode) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } controller_->SetWindowMode(app_id, window_mode); } @@ -280,8 +285,9 @@ void StandaloneBrowserExtensionApps::SetWindowMode(const std::string& app_id, void StandaloneBrowserExtensionApps::StopApp(const std::string& app_id) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } controller_->StopApp(app_id); } @@ -300,8 +306,9 @@ void StandaloneBrowserExtensionApps::OpenNativeSettings( const std::string& app_id) { // It is possible that Lacros is briefly unavailable, for example if it shuts // down for an update. - if (!controller_.is_bound()) + if (!controller_.is_bound()) { return; + } controller_->OpenNativeSettings(app_id); } diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc index d018f5578dca4..f76ed52d3b15a 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc @@ -310,8 +310,9 @@ void WebAppsCrosapi::ExecuteContextMenuCommand(const std::string& app_id, } void WebAppsCrosapi::OnApps(std::vector<AppPtr> deltas) { - if (!web_app::IsWebAppsCrosapiEnabled()) + if (!web_app::IsWebAppsCrosapiEnabled()) { return; + } on_initial_apps_received_ = true; diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.cc b/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.cc index 015389204debb..75f1d9faf573c 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.cc +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.cc @@ -44,9 +44,8 @@ WebAppsCrosapiFactory::WebAppsCrosapiFactory() std::unique_ptr<KeyedService> WebAppsCrosapiFactory::BuildServiceInstanceForBrowserContext( content::BrowserContext* context) const { - return std::make_unique<WebAppsCrosapi>( - AppServiceProxyFactory::GetForProfile( - Profile::FromBrowserContext(context))); + return std::make_unique<WebAppsCrosapi>(AppServiceProxyFactory::GetForProfile( + Profile::FromBrowserContext(context))); } } // namespace apps diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.h b/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.h index 6de86b23bc2cf..edc5782af4b3c 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.h +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi_factory.h @@ -34,7 +34,7 @@ class WebAppsCrosapiFactory : public ProfileKeyedServiceFactory { // BrowserContextKeyedServiceFactory overrides. std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext( - content::BrowserContext* context) const override; + content::BrowserContext* context) const override; }; } // namespace apps diff --git a/chrome/browser/apps/app_service/uninstall_dialog.cc b/chrome/browser/apps/app_service/uninstall_dialog.cc index dec683240468a..ffe9a56361a1e 100644 --- a/chrome/browser/apps/app_service/uninstall_dialog.cc +++ b/chrome/browser/apps/app_service/uninstall_dialog.cc @@ -28,8 +28,9 @@ UninstallDialog::UninstallDialog(Profile* profile, app_name_(app_name), parent_window_(parent_window), uninstall_callback_(std::move(uninstall_callback)) { - if (parent_window) + if (parent_window) { parent_window_tracker_ = views::NativeWindowTracker::Create(parent_window); + } } UninstallDialog::~UninstallDialog() = default; diff --git a/chrome/browser/apps/app_service/web_contents_app_id_utils.cc b/chrome/browser/apps/app_service/web_contents_app_id_utils.cc index 15597620c1c11..32e8f854f03bc 100644 --- a/chrome/browser/apps/app_service/web_contents_app_id_utils.cc +++ b/chrome/browser/apps/app_service/web_contents_app_id_utils.cc @@ -125,8 +125,9 @@ std::optional<std::string> GetInstanceAppIdForWebContents( std::string GetAppIdForWebContents(content::WebContents* web_contents) { const webapps::AppId* app_id = web_app::WebAppTabHelper::GetAppId(web_contents); - if (app_id) + if (app_id) { return *app_id; + } extensions::TabHelper* extensions_tab_helper = extensions::TabHelper::FromWebContents(web_contents); diff --git a/chrome/browser/apps/app_service/webapk/webapk_prefs.cc b/chrome/browser/apps/app_service/webapk/webapk_prefs.cc index c8e66782985be..cbc36105ce149 100644 --- a/chrome/browser/apps/app_service/webapk/webapk_prefs.cc +++ b/chrome/browser/apps/app_service/webapk/webapk_prefs.cc @@ -121,8 +121,9 @@ void SetUpdateNeededForApp(Profile* profile, ScopedDictPrefUpdate generated_webapks(profile->GetPrefs(), kGeneratedWebApksPref); base::Value::Dict* app_dict = generated_webapks->FindDict(app_id); - if (app_dict) + if (app_dict) { app_dict->Set(kUpdateNeededKey, update_needed); + } } base::flat_set<std::string> GetUpdateNeededAppIds(Profile* profile) {