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

Unified Diff: chrome/browser/android/data_usage/data_use_ui_tab_model.h

Issue 1539763004: Miscellaneous fixes to DataUse UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, addressed megjablon comments Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/data_usage/data_use_ui_tab_model.h
diff --git a/chrome/browser/android/data_usage/data_use_ui_tab_model.h b/chrome/browser/android/data_usage/data_use_ui_tab_model.h
index 9e589d429544c5ca17d1ee8897586afd42279c70..d291215aa40b328cd21a200eb9e3662b137f5626 100644
--- a/chrome/browser/android/data_usage/data_use_ui_tab_model.h
+++ b/chrome/browser/android/data_usage/data_use_ui_tab_model.h
@@ -59,8 +59,8 @@ class DataUseUITabModel : public KeyedService,
// Reports a custom tab navigation to the DataUseTabModel on the IO thread.
// Includes the |tab_id|, |url|, and |package_name| for the navigation.
void ReportCustomTabInitialNavigation(SessionID::id_type tab_id,
- const std::string& url,
- const std::string& package_name);
+ const std::string& package_name,
+ const std::string& url);
// Returns true if data use tracking has been started for the tab with id
// |tab_id|. Calling this function resets the state of the tab.
@@ -74,11 +74,26 @@ class DataUseUITabModel : public KeyedService,
// caller.
void SetDataUseTabModel(DataUseTabModel* data_use_tab_model);
+ // Returns true if the tab with id |tab_id| is currently tracked, and
+ // starting the navigation to |url| with transition type |page_transition|
+ // would end tracking of data use.
megjablon 2015/12/29 00:38:24 Add "Should only be called before the navigation s
tbansal1 2015/12/29 01:18:41 Done.
+ bool WouldDataUseTrackingEnd(const std::string& url,
+ int page_transition,
+ SessionID::id_type tab_id) const;
+
+ // Notifies that user clicked "Continue" when the dialog box with data use
+ // warning was shown. Includes the |tab_id| on which the warning was shown.
+ // When the user clicks "Continue", additional UI warnings about exiting data
+ // use tracking are not shown to the user.
+ void UserClickedContinueOnDialogBox(SessionID::id_type tab_id);
+
base::WeakPtr<DataUseUITabModel> GetWeakPtr();
private:
FRIEND_TEST_ALL_PREFIXES(DataUseUITabModelTest, ConvertTransitionType);
FRIEND_TEST_ALL_PREFIXES(DataUseUITabModelTest, EntranceExitState);
+ FRIEND_TEST_ALL_PREFIXES(DataUseUITabModelTest,
+ EntranceExitStateWithDialogBox);
FRIEND_TEST_ALL_PREFIXES(DataUseUITabModelTest, ReportTabEventsTest);
// DataUseTrackingEvent indicates the state of a tab.
@@ -88,6 +103,9 @@ class DataUseUITabModel : public KeyedService,
// Indicates that data use tracking has ended.
DATA_USE_TRACKING_ENDED,
+
+ // Indicates that user clicked "Continue" when the dialog box was shown.
+ DATA_USE_CONTINUE_CLICKED,
};
typedef base::hash_map<SessionID::id_type, DataUseTrackingEvent> TabEvents;

Powered by Google App Engine
This is Rietveld 408576698