Commit 102dc9c8 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Remove final BrowserState-scoped NTP uma function.

Removes the final call site for the NTP uma function that used
TabModelList to get the active web state.

Bug: 1032550
Change-Id: Id4630e2691efd7d60febea20e15bd7fcfe3ff1cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2085271Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747194}
parent 83122a78
......@@ -38,10 +38,6 @@ void RecordAction(ChromeBrowserState* browser_state,
web::WebState* web_state,
ActionType action);
// DEPRECATED -- use the version above which passes web_state instead.
// TODO(crbug.com/1032550) : Remove this function.
void RecordAction(ChromeBrowserState* browser_state, ActionType action);
void RecordActionFromOmnibox(ChromeBrowserState* browser_state,
web::WebState* web_state,
const GURL& url,
......
......@@ -34,15 +34,6 @@ void RecordAction(ChromeBrowserState* browser_state,
counter->Add(action);
}
void RecordAction(ChromeBrowserState* browser_state, ActionType action) {
DCHECK(browser_state);
WebStateList* web_state_list =
TabModelList::GetLastActiveTabModelForChromeBrowserState(browser_state)
.webStateList;
return RecordAction(browser_state, web_state_list->GetActiveWebState(),
action);
}
void RecordActionFromOmnibox(ChromeBrowserState* browser_state,
web::WebState* web_state,
const GURL& url,
......
......@@ -95,6 +95,7 @@ source_set("history_ui") {
"//ios/chrome/browser/ui/table_view/cells:cells_constants",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/url_loading",
"//ios/chrome/browser/web_state_list",
"//ios/chrome/common/ui/favicon",
"//ios/chrome/common/ui/util",
"//ui/base",
......
......@@ -37,6 +37,7 @@
#import "ios/chrome/browser/url_loading/url_loading_params.h"
#import "ios/chrome/browser/url_loading/url_loading_service.h"
#import "ios/chrome/browser/url_loading/url_loading_service_factory.h"
#include "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/chrome/common/ui/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui/colors/semantic_color_names.h"
#import "ios/chrome/common/ui/favicon/favicon_view.h"
......@@ -1062,9 +1063,10 @@ const CGFloat kButtonHorizontalPadding = 30.0;
// Opens URL in the current tab and dismisses the history view.
- (void)openURL:(const GURL&)URL {
// TODO(crbug.com/1032550) : Update this call to pass in the current WebState.
new_tab_page_uma::RecordAction(_browser->GetBrowserState(),
new_tab_page_uma::ACTION_OPENED_HISTORY_ENTRY);
new_tab_page_uma::RecordAction(
_browser->GetBrowserState(),
_browser->GetWebStateList()->GetActiveWebState(),
new_tab_page_uma::ACTION_OPENED_HISTORY_ENTRY);
UrlLoadParams params = UrlLoadParams::InCurrentTab(URL);
params.web_params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
params.load_strategy = self.loadStrategy;
......
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