Skip to content

Commit

Permalink
Navigation transitions (web to native app): Get names and rects of tr…
Browse files Browse the repository at this point in the history
…ansition elements (Step 5)

Web to native app navigation transition uses Activity Transitions APIs in Android L. It requires the names and rects of transition elements. This CL gets the names and rects and pass them to TransitionRequestManager.

Design doc: https://docs.google.com/a/chromium.org/document/d/17jg1RRL3RI969cLwbKBIcoGDsPwqaEdBxafGNYGwiY4/edit#
Demo video: https://drive.google.com/a/google.com/file/d/0B3hetueIc91Gd01DU25uT2hWU2M/view?usp=sharing
Activity Transitions in Android L: https://developer.android.com/preview/material/animations.html#transitions

================

Originally this was a 3-way patch since it involves API change in WebFrameClient.h. After the chrome side impl was committed (step 1), we found that it is better to pass struct instead of long list of params. So this turns out to be a 5-way patch.

Here are the 5 steps:
1. Chrome side - save the data (https://codereview.chromium.org/652283002/).
2. Blink side - getting the data and introduce struct WebTransitionElementData, but still using long list of params (https://codereview.chromium.org/654953002/).
3. Chrome side - implement the API with WebTransitionElementData (https://codereview.chromium.org/679813003/).
4. Blink side - remove old APIs that use long list of params and start to use new API with WebTransitionElementData (https://codereview.chromium.org/721973002/).
5. Chrome side - remove redundent implmentations of the old APIs (this CL).

BUG=370696

Review URL: https://codereview.chromium.org/728653003

Cr-Commit-Position: refs/heads/master@{#304232}
  • Loading branch information
wangzhen127 authored and Commit bot committed Nov 14, 2014
1 parent 7eb7ab5 commit 344eaad
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
22 changes: 0 additions & 22 deletions content/renderer/render_frame_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2563,28 +2563,6 @@ void RenderFrameImpl::didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame) {
render_view_->didUpdateCurrentHistoryItem(frame);
}

// TODO(zhenw): This will be removed once the blink side implementation is done.
void RenderFrameImpl::addNavigationTransitionData(
const blink::WebString& allowed_destination_host_pattern,
const blink::WebString& selector,
const blink::WebString& markup,
const blink::WebVector<blink::WebString>& web_ids,
const blink::WebVector<blink::WebRect>& web_rects) {
FrameHostMsg_AddNavigationTransitionData_Params params;
params.render_frame_id = routing_id_;
params.allowed_destination_host_pattern =
allowed_destination_host_pattern.utf8();
params.selector = selector.utf8();
params.markup = markup.utf8();
params.elements.resize(web_ids.size());
for (size_t i = 0; i < web_ids.size(); i++) {
params.elements[i].id = web_ids[i].utf8();
params.elements[i].rect = gfx::Rect(web_rects[i]);
}

Send(new FrameHostMsg_AddNavigationTransitionData(params));
}

void RenderFrameImpl::addNavigationTransitionData(
const blink::WebTransitionElementData& data) {
FrameHostMsg_AddNavigationTransitionData_Params params;
Expand Down
6 changes: 0 additions & 6 deletions content/renderer/render_frame_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,6 @@ class CONTENT_EXPORT RenderFrameImpl
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type);
virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame);
virtual void addNavigationTransitionData(
const blink::WebString& allowedDestinationOrigin,
const blink::WebString& selector,
const blink::WebString& markup,
const blink::WebVector<blink::WebString>& web_ids,
const blink::WebVector<blink::WebRect>& web_rects);
virtual void addNavigationTransitionData(
const blink::WebTransitionElementData& data);
virtual void didChangeThemeColor();
Expand Down

0 comments on commit 344eaad

Please sign in to comment.