refactor titlebar code

Change-Id: I45db5f19af142ba78d3e3833fa428e8f9a14b889
10 files changed