Persist text directionality information

- Added new field to protobuff for text directionality
- Add "dir" attribute to content elements using computed style

BUG=374404
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/634403005
Add directionality test to suite and correct test case

BUG=374404
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/678613002
add option for original domain

- this is part of the implementation of scoring mechanism for next/prev page
  links.
- scoring framework uses files, instead of live urls, when calling distiller.
  detection of next/prev page links expects the same domain for current page and
  paging links, which isn't the case when current page is a file://.
- this is rectified by having an option to specify the original domain
  associated with the current page if it's a file://.
- detection algorithm uses this original domain when determining location host.
- fixed and added tests.

BUG=425952
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/661883003
Add a list of extra timings to timinginfo

BUG=431067
R=nyquist@chromium.org

Review URL: https://codereview.chromium.org/706083002
Fix the ordering of extra timing in proto

The ordering is more strict for json C++ header.

BUG=
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/712503002
Trim trailing spaces in dom_distiller client

This is done by running command:
$ find src/com -type f | xargs perl -pi.bak -e 's/ +$//'

BUG=
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/710783002
Initial header image detection on articles.

Many articles have a large, article-width image above the main
content that is not detected by the distiller because it is
outside of the main content area and/or preceeds the article.

Several heuristics are used to rank and retrieve potential article
head images. Only images that have not already been marked as
content are considered. The following heuristics are used:
- DOM distance from first content node
- Image area (width*height)
- Image width/height ratio
- Has "figure" tag ancestor

Images are ranked in-place to retain their position in the DOM
and only a single image is chosen (assuming its score is above
a certain threshold). This addition is contained as part of
RelevantElementsFinder since the header image is exactly that; a
relevant element to the article.

BUG=427636
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/688523003
Print top-level timing information

BUG=None
R=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/723313003
Add content_image field to protobuff for scoring.

I have replaced a field in the DomDistillerResult protobuff called
"image_urls" that was almost entirely unused (one loop that never
ran inside of chromium). I have removed this field and replaced it with
a repeated "ContentImage" field that is designed to contain the
URL and, eventually, other information about the image. The primary
purpose of this change, currently, is for article scoring. Code has
also been added to populate this new field.

BUG=None
R=nyquist@chromium.org

Review URL: https://codereview.chromium.org/733573002
Create a simple reader mode extension

The extension simply adds a page action on every page. When clicked, it will
inject our javascript and collect a profile of the extraction.

BUG=431067
R=nyquist@chromium.org

Review URL: https://codereview.chromium.org/741243002
Merge remote-tracking branch 'upstream/master'

* upstream/master:
  Create a simple reader mode extension
  Add content_image field to protobuff for scoring.
  Print top-level timing information
  Initial header image detection on articles.
  Trim trailing spaces in dom_distiller client
  Fix the ordering of extra timing in proto
  Add a list of extra timings to timinginfo
  add option for original domain
  Add directionality test to suite and correct test case
  Persist text directionality information