Commit dc23344a authored by mrefaat's avatar mrefaat Committed by Commit Bot

Move AppLauncherAbuseDetector to ios/chrome/browser/app_launcher

AppLauncherAbuseDetector & AppLaunchingState classes were on
ios/chrome/browser/web. But they are not related to web.
Moving these classes put togather all app launching logic on the same
place, and also breaks app_launcher target dependency
on ios/chrome/browser/web:web_internal which can be a reason for cyclic
dependency for targets that depend on AppLauncherTabHelper.

Bug: 850760
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I743c9add64b939430c287b6fddd9cd77c082d697
Reviewed-on: https://chromium-review.googlesource.com/1158125
Commit-Queue: Mohammad Refaat <mrefaat@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580096}
parent 0a26ad31
......@@ -7,9 +7,13 @@ import("//build/config/ios/rules.gni")
source_set("app_launcher") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"app_launcher_abuse_detector.h",
"app_launcher_abuse_detector.mm",
"app_launcher_tab_helper.h",
"app_launcher_tab_helper.mm",
"app_launcher_tab_helper_delegate.h",
"app_launching_state.h",
"app_launching_state.mm",
]
deps = [
"//base",
......@@ -17,7 +21,6 @@ source_set("app_launcher") {
"//ios/chrome/browser",
"//ios/chrome/browser/reading_list",
"//ios/chrome/browser/tabs",
"//ios/chrome/browser/web:web_internal",
"//ios/web/public",
"//url",
]
......@@ -27,11 +30,14 @@ source_set("unit_tests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"app_launcher_abuse_detector_unittest.mm",
"app_launcher_tab_helper_unittest.mm",
"app_launching_state_unittest.mm",
]
deps = [
":app_launcher",
"//base",
"//base/test:test_support",
"//ios/chrome/browser",
"//ios/chrome/browser/web:web_internal",
"//ios/web/public/test/fakes",
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_WEB_APP_LAUNCHER_ABUSE_DETECTOR_H_
#define IOS_CHROME_BROWSER_WEB_APP_LAUNCHER_ABUSE_DETECTOR_H_
#ifndef IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHER_ABUSE_DETECTOR_H_
#define IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHER_ABUSE_DETECTOR_H_
#import <Foundation/Foundation.h>
......@@ -46,4 +46,4 @@ extern const int kMaxAllowedConsecutiveExternalAppLaunches;
fromSourcePageURL:(const GURL&)sourcePageURL;
@end
#endif // IOS_CHROME_BROWSER_WEB_APP_LAUNCHER_ABUSE_DETECTOR_H_
#endif // IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHER_ABUSE_DETECTOR_H_
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/web/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/web/app_launching_state.h"
#import "ios/chrome/browser/app_launcher/app_launching_state.h"
#include "url/gurl.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/chrome/browser/web/app_launcher_abuse_detector.h"
#include "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
......
......@@ -10,12 +10,12 @@
#include "base/metrics/histogram_macros.h"
#import "base/strings/sys_string_conversions.h"
#include "components/reading_list/core/reading_list_model.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper_delegate.h"
#import "ios/chrome/browser/chrome_url_util.h"
#include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
#import "ios/chrome/browser/tabs/legacy_tab_helper.h"
#import "ios/chrome/browser/tabs/tab.h"
#import "ios/chrome/browser/web/app_launcher_abuse_detector.h"
#import "ios/web/public/navigation_item.h"
#import "ios/web/public/navigation_manager.h"
#import "ios/web/public/url_scheme_util.h"
......
......@@ -7,9 +7,9 @@
#include <memory>
#include "base/compiler_specific.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper_delegate.h"
#import "ios/chrome/browser/chrome_url_util.h"
#import "ios/chrome/browser/web/app_launcher_abuse_detector.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_WEB_APP_LAUNCHING_STATE_H_
#define IOS_CHROME_BROWSER_WEB_APP_LAUNCHING_STATE_H_
#ifndef IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHING_STATE_H_
#define IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHING_STATE_H_
#import <Foundation/Foundation.h>
......@@ -33,4 +33,4 @@ extern const double kDefaultMaxSecondsBetweenConsecutiveExternalAppLaunches;
- (void)updateWithLaunchRequest;
@end
#endif // IOS_CHROME_BROWSER_WEB_APP_LAUNCHING_STATE_H_
#endif // IOS_CHROME_BROWSER_APP_LAUNCHER_APP_LAUNCHING_STATE_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/web/app_launching_state.h"
#import "ios/chrome/browser/app_launcher/app_launching_state.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/web/app_launching_state.h"
#import "ios/chrome/browser/app_launcher/app_launching_state.h"
#import "base/test/ios/wait_util.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -53,6 +53,7 @@
#include "components/strings/grit/components_strings.h"
#include "components/toolbar/toolbar_model_impl.h"
#include "ios/chrome/app/tests_hook.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper.h"
#import "ios/chrome/browser/autofill/autofill_tab_helper.h"
#import "ios/chrome/browser/autofill/form_input_accessory_coordinator.h"
......@@ -229,7 +230,6 @@
#import "ios/chrome/browser/ui/voice/text_to_speech_playback_controller_factory.h"
#include "ios/chrome/browser/upgrade/upgrade_center.h"
#import "ios/chrome/browser/voice/voice_search_navigations_tab_helper.h"
#import "ios/chrome/browser/web/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/web/blocked_popup_tab_helper.h"
#import "ios/chrome/browser/web/error_page_content.h"
#import "ios/chrome/browser/web/load_timing_tab_helper.h"
......
......@@ -166,10 +166,6 @@ js_compile_checked("accessibility") {
source_set("web_internal") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"app_launcher_abuse_detector.h",
"app_launcher_abuse_detector.mm",
"app_launching_state.h",
"app_launching_state.mm",
"blocked_popup_tab_helper.h",
"blocked_popup_tab_helper.mm",
"chrome_web_client.h",
......@@ -248,8 +244,6 @@ source_set("unit_tests_internal") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"app_launcher_abuse_detector_unittest.mm",
"app_launching_state_unittest.mm",
"blocked_popup_tab_helper_unittest.mm",
"chrome_web_client_unittest.mm",
"error_page_generator_unittest.mm",
......
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