WebContents::Type GetTypeFromViewType(extensions::ViewType view_type) {
  switch (view_type) {
    case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE:
      return WebContents::Type::kBackgroundPage;

    case extensions::VIEW_TYPE_APP_WINDOW:
    case extensions::VIEW_TYPE_COMPONENT:
    case extensions::VIEW_TYPE_EXTENSION_DIALOG:
    case extensions::VIEW_TYPE_EXTENSION_POPUP:
    case extensions::VIEW_TYPE_BACKGROUND_CONTENTS:
    case extensions::VIEW_TYPE_EXTENSION_GUEST:
    case extensions::VIEW_TYPE_TAB_CONTENTS:
    case extensions::VIEW_TYPE_INVALID:
      return WebContents::Type::kRemote;
  }
}
WebContents::Type GetTypeFromViewType(extensions::ViewType view_type) {
  switch (view_type) {
    case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE:
      return WebContents::Type::kBackgroundPage;

    case extensions::VIEW_TYPE_APP_WINDOW:
    case extensions::VIEW_TYPE_COMPONENT:
    case extensions::VIEW_TYPE_EXTENSION_DIALOG:
    case extensions::VIEW_TYPE_EXTENSION_POPUP:
    case extensions::VIEW_TYPE_BACKGROUND_CONTENTS:
    case extensions::VIEW_TYPE_EXTENSION_GUEST:
    case extensions::VIEW_TYPE_TAB_CONTENTS:
    case extensions::VIEW_TYPE_INVALID:
      return WebContents::Type::kRemote;
  }
}