Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: ios/chrome/app/main_controller.mm

Issue 2643723004: Add Desktop iOS promotion logging to chrome ios app. (Closed)
Patch Set: adding histogram changes and addressing comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/app/main_controller.h" 5 #import "ios/chrome/app/main_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #import <CoreSpotlight/CoreSpotlight.h> 10 #import <CoreSpotlight/CoreSpotlight.h>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" 64 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h"
65 #include "ios/chrome/browser/callback_counter.h" 65 #include "ios/chrome/browser/callback_counter.h"
66 #include "ios/chrome/browser/chrome_paths.h" 66 #include "ios/chrome/browser/chrome_paths.h"
67 #include "ios/chrome/browser/chrome_url_constants.h" 67 #include "ios/chrome/browser/chrome_url_constants.h"
68 #import "ios/chrome/browser/chrome_url_util.h" 68 #import "ios/chrome/browser/chrome_url_util.h"
69 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory. h" 69 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory. h"
70 #include "ios/chrome/browser/crash_loop_detection_util.h" 70 #include "ios/chrome/browser/crash_loop_detection_util.h"
71 #include "ios/chrome/browser/crash_report/breakpad_helper.h" 71 #include "ios/chrome/browser/crash_report/breakpad_helper.h"
72 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" 72 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h"
73 #import "ios/chrome/browser/crash_report/crash_restore_helper.h" 73 #import "ios/chrome/browser/crash_report/crash_restore_helper.h"
74 #include "ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.h "
74 #include "ios/chrome/browser/experimental_flags.h" 75 #include "ios/chrome/browser/experimental_flags.h"
75 #include "ios/chrome/browser/file_metadata_util.h" 76 #include "ios/chrome/browser/file_metadata_util.h"
76 #import "ios/chrome/browser/first_run/first_run.h" 77 #import "ios/chrome/browser/first_run/first_run.h"
77 #include "ios/chrome/browser/geolocation/omnibox_geolocation_controller.h" 78 #include "ios/chrome/browser/geolocation/omnibox_geolocation_controller.h"
78 #include "ios/chrome/browser/ios_chrome_io_thread.h" 79 #include "ios/chrome/browser/ios_chrome_io_thread.h"
79 #import "ios/chrome/browser/memory/memory_debugger_manager.h" 80 #import "ios/chrome/browser/memory/memory_debugger_manager.h"
80 #include "ios/chrome/browser/metrics/first_user_action_recorder.h" 81 #include "ios/chrome/browser/metrics/first_user_action_recorder.h"
81 #import "ios/chrome/browser/metrics/previous_session_info.h" 82 #import "ios/chrome/browser/metrics/previous_session_info.h"
82 #import "ios/chrome/browser/net/cookie_util.h" 83 #import "ios/chrome/browser/net/cookie_util.h"
83 #include "ios/chrome/browser/net/crl_set_fetcher.h" 84 #include "ios/chrome/browser/net/crl_set_fetcher.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // been processed in the last 200ms in order to only allow processing one at 329 // been processed in the last 200ms in order to only allow processing one at
329 // a time. 330 // a time.
330 // TODO(crbug.com/560296): Provide a general solution for handling mutually 331 // TODO(crbug.com/560296): Provide a general solution for handling mutually
331 // exclusive chrome commands sent at nearly the same time. 332 // exclusive chrome commands sent at nearly the same time.
332 BOOL _isProcessingTabSwitcherCommand; 333 BOOL _isProcessingTabSwitcherCommand;
333 BOOL _isProcessingVoiceSearchCommand; 334 BOOL _isProcessingVoiceSearchCommand;
334 335
335 // Bridge to listen to pref changes. 336 // Bridge to listen to pref changes.
336 std::unique_ptr<PrefObserverBridge> _localStatePrefObserverBridge; 337 std::unique_ptr<PrefObserverBridge> _localStatePrefObserverBridge;
337 338
339 // Sync service observer for the desktop ios promotion logging.
340 std::unique_ptr<DesktopPromotionSyncObserver> _desktopPromotionSyncObserver;
rohitrao (ping after 24h) 2017/01/23 20:31:39 Can this be a BrowserStateKeyedService instead of
341
338 // Registrar for pref changes notifications to the local state. 342 // Registrar for pref changes notifications to the local state.
339 PrefChangeRegistrar _localStatePrefChangeRegistrar; 343 PrefChangeRegistrar _localStatePrefChangeRegistrar;
340 344
341 // Clears browsing data from ChromeBrowserStates. 345 // Clears browsing data from ChromeBrowserStates.
342 base::scoped_nsobject<BrowsingDataRemovalController> 346 base::scoped_nsobject<BrowsingDataRemovalController>
343 _browsingDataRemovalController; 347 _browsingDataRemovalController;
344 348
345 // The class in charge of showing/hiding the memory debugger when the 349 // The class in charge of showing/hiding the memory debugger when the
346 // appropriate pref changes. 350 // appropriate pref changes.
347 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager; 351 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager;
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 new PrefObserverBridge(self)); 1056 new PrefObserverBridge(self));
1053 _localStatePrefChangeRegistrar.Init( 1057 _localStatePrefChangeRegistrar.Init(
1054 GetApplicationContext()->GetLocalState()); 1058 GetApplicationContext()->GetLocalState());
1055 _localStatePrefObserverBridge->ObserveChangesForPreference( 1059 _localStatePrefObserverBridge->ObserveChangesForPreference(
1056 metrics::prefs::kMetricsReportingEnabled, 1060 metrics::prefs::kMetricsReportingEnabled,
1057 &_localStatePrefChangeRegistrar); 1061 &_localStatePrefChangeRegistrar);
1058 _localStatePrefObserverBridge->ObserveChangesForPreference( 1062 _localStatePrefObserverBridge->ObserveChangesForPreference(
1059 prefs::kMetricsReportingWifiOnly, 1063 prefs::kMetricsReportingWifiOnly,
1060 &_localStatePrefChangeRegistrar); 1064 &_localStatePrefChangeRegistrar);
1061 1065
1066 // Track Sync state changes.
1067 _desktopPromotionSyncObserver.reset(
1068 new DesktopPromotionSyncObserver(
1069 [self currentBrowserState]));
rohitrao (ping after 24h) 2017/01/23 20:31:39 Are you intentionally calling |currentBrowserState
mrefaat 2017/01/24 19:57:19 changed to use _mainBrowserState - we don't care a
1070
1062 // Calls the onPreferenceChanged function in case there was 1071 // Calls the onPreferenceChanged function in case there was
1063 // a 1072 // a
1064 // change to the observed preferences before the observer 1073 // change to the observed preferences before the observer
1065 // bridge was set up. 1074 // bridge was set up.
1066 [self onPreferenceChanged:metrics::prefs:: 1075 [self onPreferenceChanged:metrics::prefs::
1067 kMetricsReportingEnabled]; 1076 kMetricsReportingEnabled];
1068 [self onPreferenceChanged:prefs::kMetricsReportingWifiOnly]; 1077 [self onPreferenceChanged:prefs::kMetricsReportingWifiOnly];
1069 }]; 1078 }];
1070 } 1079 }
1071 1080
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 }; 2701 };
2693 2702
2694 callbackCounter->IncrementCount(); 2703 callbackCounter->IncrementCount();
2695 [self removeBrowsingDataFromBrowserState:_mainBrowserState 2704 [self removeBrowsingDataFromBrowserState:_mainBrowserState
2696 mask:removeAllMask 2705 mask:removeAllMask
2697 timePeriod:browsing_data::ALL_TIME 2706 timePeriod:browsing_data::ALL_TIME
2698 completionHandler:decrementCallbackCounterCount]; 2707 completionHandler:decrementCallbackCounterCount];
2699 } 2708 }
2700 2709
2701 @end 2710 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698