Cleanup: Introducing moving code to a separate function.
Cleanup: Introducing moving code to a separate function.

This is a continuation of the former codereview (
http://codereview.chromium.org/3579012) witch detached from git because of my mistake.

BUG=chromium-os:7008
TEST=none

Review URL: http://codereview.chromium.org/3793004

git-svn-id: http://src.chromium.org/svn/trunk/src@62599 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 2c34ff8b3f7611303a6e38f7d2e21c7ffea893b5
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser