Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: chrome/browser/resources/pdf/ui_manager.js

Issue 966293002: Make sure the PDF material toolbar gets hidden after loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 var HIDE_TIMEOUT = 2000; 7 var HIDE_TIMEOUT = 2000;
8 8
9 /** 9 /**
10 * Creates a UI Manager to handle transitioning of toolbars and panes. 10 * Creates a UI Manager to handle transitioning of toolbars and panes.
(...skipping 17 matching lines...) Expand all
28 UiManager.prototype = { 28 UiManager.prototype = {
29 /** 29 /**
30 * @private 30 * @private
31 * Display the toolbar and any pane that was previously opened. 31 * Display the toolbar and any pane that was previously opened.
32 */ 32 */
33 showUi_: function() { 33 showUi_: function() {
34 this.toolbar_.show(); 34 this.toolbar_.show();
35 for (var i = 0; i < this.panes_.length; i++) 35 for (var i = 0; i < this.panes_.length; i++)
36 this.panes_[i].showIfOpenedByUser(); 36 this.panes_[i].showIfOpenedByUser();
37 37
38 if (this.uiTimeout_) 38 this.hideUiAfterTimeout();
39 clearTimeout(this.uiTimeout_);
40 this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT);
41 }, 39 },
42 40
43 /** 41 /**
44 * @private 42 * @private
45 * Hide the toolbar and any pane that was previously opened. 43 * Hide the toolbar and any pane that was previously opened.
46 */ 44 */
47 hideUi_: function() { 45 hideUi_: function() {
48 this.toolbar_.hide(); 46 this.toolbar_.hide();
49 for (var i = 0; i < this.panes_.length; i++) 47 for (var i = 0; i < this.panes_.length; i++)
50 this.panes_[i].hideIfOpenedByUser(); 48 this.panes_[i].hideIfOpenedByUser();
49 },
50
51 /**
52 * @private
Sam McNally 2015/03/02 02:25:39 Remove.
53 * Hide the toolbar after the HIDE_TIMEOUT has elapsed.
54 */
55 hideUiAfterTimeout: function() {
56 if (this.uiTimeout_)
57 clearTimeout(this.uiTimeout_);
58 this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT);
51 } 59 }
52 }; 60 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698