Chromium Code Reviews| Index: content/browser/transition_request_manager.cc |
| diff --git a/content/browser/transition_request_manager.cc b/content/browser/transition_request_manager.cc |
| index e2c83ea0dea38f65020276cf83cb892262f7577b..b863991c7195c16003fb94706a49abd682806818 100644 |
| --- a/content/browser/transition_request_manager.cc |
| +++ b/content/browser/transition_request_manager.cc |
| @@ -82,6 +82,22 @@ TransitionLayerData::TransitionLayerData() { |
| TransitionLayerData::~TransitionLayerData() { |
| } |
| +TransitionRequestManager::TransitionRequestData::AllowedEntry::AllowedEntry( |
| + const std::string& allowed_destination_host_pattern, |
| + const std::string& css_selector, |
| + const std::string& markup, |
| + const std::vector<std::string>& names, |
| + const std::vector<gfx::Rect>& rects) |
| + : allowed_destination_host_pattern(allowed_destination_host_pattern), |
| + css_selector(css_selector), |
| + markup(markup), |
| + names(names), |
| + rects(rects) { |
| +} |
| + |
| +TransitionRequestManager::TransitionRequestData::AllowedEntry::~AllowedEntry() { |
| +} |
| + |
| void TransitionRequestManager::ParseTransitionStylesheetsFromHeaders( |
| const scoped_refptr<net::HttpResponseHeaders>& headers, |
| std::vector<GURL>& entering_stylesheets, |
| @@ -112,10 +128,14 @@ TransitionRequestManager::TransitionRequestData::~TransitionRequestData() { |
| void TransitionRequestManager::TransitionRequestData::AddEntry( |
| const std::string& allowed_destination_host_pattern, |
| const std::string& css_selector, |
| - const std::string& markup) { |
| + const std::string& markup, |
| + const std::vector<std::string>& names, |
| + const std::vector<gfx::Rect>& rects) { |
| allowed_entries_.push_back(AllowedEntry(allowed_destination_host_pattern, |
| css_selector, |
| - markup)); |
| + markup, |
| + names, |
| + rects)); |
| } |
| bool TransitionRequestManager::TransitionRequestData::FindEntry( |
| @@ -133,6 +153,8 @@ bool TransitionRequestManager::TransitionRequestData::FindEntry( |
| const AllowedEntry& allowed_entry = allowed_entries_[0]; |
| transition_data->markup = allowed_entry.markup; |
| transition_data->css_selector = allowed_entry.css_selector; |
| + transition_data->names = allowed_entry.names; |
| + transition_data->rects = allowed_entry.rects; |
| return true; |
| } |
| @@ -155,13 +177,28 @@ void TransitionRequestManager::AddPendingTransitionRequestData( |
| int render_frame_id, |
| const std::string& allowed_destination_host_pattern, |
| const std::string& css_selector, |
| - const std::string& markup) { |
| + const std::string& markup, |
| + const std::vector<std::string>& names, |
| + const std::vector<gfx::Rect>& rects) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + |
| + std::pair<int, int> key(render_process_id, render_frame_id); |
| + pending_transition_frames_[key].AddEntry( |
| + allowed_destination_host_pattern, css_selector, markup, names, rects); |
| +} |
| + |
| +void TransitionRequestManager::AddPendingTransitionRequestDataForTesting( |
| + int render_process_id, |
| + int render_frame_id) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| std::pair<int, int> key(render_process_id, render_frame_id); |
| - pending_transition_frames_[key].AddEntry(allowed_destination_host_pattern, |
| - css_selector, |
| - markup); |
| + pending_transition_frames_[key].AddEntry( |
| + "*", /* allowed_destination_host_pattern */ |
| + "", /* css_selector */ |
| + "", /* markup */ |
| + std::vector<std::string>(), /* names */ |
| + std::vector<gfx::Rect>()); /* rects */ |
|
nasko
2014/10/17 20:04:19
It seems strange to me to hardcode those in this m
Zhen Wang
2014/10/17 21:34:29
This is because it is used in WebContentsAndroid::
nasko
2014/10/20 14:14:18
How would you test non "*" pattern then?
|
| } |
| void TransitionRequestManager::ClearPendingTransitionRequestData( |