Commit e4f0afae authored by Joon Ahn's avatar Joon Ahn Committed by Commit Bot

Use common internal account check

Bug: n/a
Change-Id: Ib1f697bce7350753cf3802bc6dac176f36139a07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1963437Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Joon Ahn <joonbug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726056}
parent 6373ebc7
......@@ -33,10 +33,10 @@
#include "chrome/browser/chromeos/system_logs/single_log_file_log_source.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "components/feedback/feedback_util.h"
#include "components/feedback/system_logs/system_logs_source.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h"
#include "google_apis/gaia/gaia_auth_util.h"
#endif // defined(OS_CHROMEOS)
namespace extensions {
......@@ -224,7 +224,7 @@ api::feedback_private::LandingPageType
ChromeFeedbackPrivateDelegate::GetLandingPageType(
const feedback::FeedbackData& feedback_data) const {
// Googlers using eve get a custom landing page.
if (!feedback_util::IsGoogleEmail(feedback_data.user_email()))
if (!gaia::IsGoogleInternalAccountEmail(feedback_data.user_email()))
return api::feedback_private::LANDING_PAGE_TYPE_NORMAL;
const std::vector<std::string> board =
......
......@@ -13,13 +13,13 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/feedback/feedback_util.h"
#include "components/prefs/pref_service.h"
#include "extensions/browser/api/feedback_private/feedback_private_api.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/signin/identity_manager_factory.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "google_apis/gaia/gaia_auth_util.h"
#endif
namespace feedback_private = extensions::api::feedback_private;
......@@ -96,7 +96,7 @@ void ShowFeedbackPage(const GURL& page_url,
#if defined(OS_CHROMEOS)
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
if (identity_manager &&
feedback_util::IsGoogleEmail(
gaia::IsGoogleInternalAccountEmail(
identity_manager->GetPrimaryAccountInfo().email)) {
flow = feedback_private::FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL;
include_bluetooth_logs = IsFromUserInteraction(source);
......
......@@ -36,6 +36,7 @@ static_library("feedback") {
"//components/variations/net",
"//content/public/browser",
"//content/public/common",
"//google_apis",
"//net",
"//services/network/public/cpp",
"//third_party/re2",
......
......@@ -7,6 +7,7 @@ include_rules = [
"+components/variations",
"+content/public/browser",
"+content/public/test",
"+google_apis/gaia",
"+net/base",
"+net/traffic_annotation",
"+net/url_request",
......
......@@ -14,6 +14,7 @@
#include "components/feedback/proto/dom.pb.h"
#include "components/feedback/proto/extension.pb.h"
#include "components/feedback/proto/math.pb.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace {
......@@ -247,7 +248,7 @@ void FeedbackCommon::AddFilesAndLogsToReport(
// @google.com email. We do this also in feedback_private_api, but not all
// code paths go through that so we need to check again here.
if (iter.first == feedback::FeedbackReport::kAllCrashReportIdsKey &&
!feedback_util::IsGoogleEmail(user_email())) {
!gaia::IsGoogleInternalAccountEmail(user_email())) {
continue;
}
......
......@@ -9,14 +9,11 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/string_util.h"
#include "third_party/zlib/google/zip.h"
namespace feedback_util {
namespace {
constexpr char kAtGoogleDotCom[] = "@google.com";
} // namespace
bool ZipString(const base::FilePath& filename,
......@@ -42,9 +39,4 @@ bool ZipString(const base::FilePath& filename,
return succeed;
}
bool IsGoogleEmail(const std::string& email) {
return base::EndsWith(email, kAtGoogleDotCom,
base::CompareCase::INSENSITIVE_ASCII);
}
} // namespace feedback_util
......@@ -15,9 +15,6 @@ bool ZipString(const base::FilePath& filename,
const std::string& data,
std::string* compressed_data);
// Returns true for google.com email addresses.
bool IsGoogleEmail(const std::string& email);
} // namespace feedback_util
#endif // COMPONENTS_FEEDBACK_FEEDBACK_UTIL_H_
......@@ -22,7 +22,6 @@
#include "base/values.h"
#include "build/build_config.h"
#include "components/feedback/feedback_report.h"
#include "components/feedback/feedback_util.h"
#include "components/feedback/system_logs/system_logs_fetcher.h"
#include "components/feedback/tracing_manager.h"
#include "extensions/browser/api/extensions_api_client.h"
......@@ -31,6 +30,7 @@
#include "extensions/browser/event_router.h"
#include "extensions/common/api/feedback_private.h"
#include "extensions/common/constants.h"
#include "google_apis/gaia/gaia_auth_util.h"
#if defined(OS_CHROMEOS)
#include "extensions/browser/api/feedback_private/log_source_access_manager.h"
......@@ -224,7 +224,7 @@ void FeedbackPrivateGetSystemInformationFunction::OnCompleted(
SystemInformationList sys_info_list;
if (sys_info) {
sys_info_list.reserve(sys_info->size());
const bool google_email = feedback_util::IsGoogleEmail(
const bool google_email = gaia::IsGoogleInternalAccountEmail(
ExtensionsAPIClient::Get()
->GetFeedbackPrivateDelegate()
->GetSignedInUserEmail(browser_context()));
......
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