Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #23281 from benfrancis/1056884
Browse files Browse the repository at this point in the history
Bug 1056884 - Implement special expanded Rocketbar state for browser start page r=kgrandon
  • Loading branch information
benfrancis committed Aug 26, 2014
2 parents 5f85fa9 + c5a71b7 commit 1c6bc15
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/system/js/app_chrome.js
Expand Up @@ -54,6 +54,7 @@

if (this.isSearchApp()) {
this.app.element.classList.add('search-app');
this.title.textContent = _('search-or-enter-address');
}

if (chrome.bar) {
Expand Down Expand Up @@ -370,6 +371,9 @@
};

AppChrome.prototype.setFreshTitle = function ac_setFreshTitle(title) {
if (this.isSearchApp()) {
return;
}
this.title.textContent = title;
clearTimeout(this._titleTimeout);
this._recentTitle = true;
Expand Down
14 changes: 14 additions & 0 deletions apps/system/style/chrome/chrome.css
Expand Up @@ -113,6 +113,20 @@
background-color: rgba(51,51,51,0.5);
border-radius: 1.8rem;
text-overflow: ellipsis;
font-style: italic;
}

.search-app .chrome.maximized .controls .urlbar:after {
content: '';
width: 2rem;
height: 100%;
top: 0;
right: 0.8rem;
position: absolute;
background-image: url('images/dark/search.png');
background-repeat: no-repeat;
background-size: 2rem auto;
background-position: center right;
}

.appWindow.light .chrome:not(.maximized) .controls .urlbar .title {
Expand Down
Binary file added apps/system/style/chrome/images/dark/search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/dark/search@1.5x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/dark/search@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/search@1.5x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/search@2.25x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/search@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/system/style/chrome/images/search@3.375x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion apps/system/test/unit/app_chrome_test.js
Expand Up @@ -60,6 +60,20 @@ suite('system/AppChrome', function() {
}
};

var fakeSearchApp = {
url: 'app://search.gaiamobile.org/newtab.html',
name: 'Browser',
manifest: {
name: 'Browser',
role: 'search',
},
manifestURL: 'app://search.gaiamobile.org/manifest.webapp',
origin: 'app://search.gaiamobile.org',
chrome: {
navigation: true
}
};

var fakeAppConfigBar = {
url: 'app://www.fake/index.html',
chrome: {
Expand Down Expand Up @@ -320,7 +334,18 @@ suite('system/AppChrome', function() {
this.sinon.clock.tick(500);
assert.equal(subject.title.textContent, 'Bing');
});


test('browser start page should always have the same title',
function() {
var app = new AppWindow(fakeSearchApp);
var chrome = new AppChrome(app);
var titleEvent = new CustomEvent('mozbrowsertitlechange', {
detail: 'Bing'
});
chrome.app.element.dispatchEvent(titleEvent);
assert.equal(chrome.title.textContent, 'search-or-enter-address');
});

test('should expand if collapsed', function() {
var stubIsBrowser = sinon.stub(subject.app, 'isBrowser', function() {
return true;
Expand Down

0 comments on commit 1c6bc15

Please sign in to comment.