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