web_view_web_main_delegate.mm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #import "ios/web_view/internal/web_view_web_main_delegate.h"
  5. #include "base/base_paths.h"
  6. #include "base/logging.h"
  7. #import "base/mac/bundle_locations.h"
  8. #include "components/component_updater/component_updater_paths.h"
  9. #if !defined(__has_feature) || !__has_feature(objc_arc)
  10. #error "This file requires ARC support."
  11. #endif
  12. // Dummy class used to locate the containing NSBundle.
  13. @interface CWVBundleLocator : NSObject
  14. @end
  15. @implementation CWVBundleLocator
  16. @end
  17. namespace ios_web_view {
  18. WebViewWebMainDelegate::WebViewWebMainDelegate() {}
  19. WebViewWebMainDelegate::~WebViewWebMainDelegate() = default;
  20. void WebViewWebMainDelegate::BasicStartupComplete() {
  21. base::mac::SetOverrideFrameworkBundle(
  22. [NSBundle bundleForClass:[CWVBundleLocator class]]);
  23. // Sets up logging so logging levels can be controlled.
  24. logging::InitLogging(logging::LoggingSettings());
  25. component_updater::RegisterPathProvider(
  26. base::DIR_APP_DATA, base::DIR_APP_DATA, base::DIR_APP_DATA);
  27. }
  28. } // namespace ios_web_view