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

Unified Diff: remoting/webapp/me2mom/toolbar.js

Issue 9148043: Rename webapp_it2me to remoting_webapp and move it from webapp/me2mom to webapp/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add webapp_it2me back Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/me2mom/toolbar.css ('k') | remoting/webapp/me2mom/ui_mode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/toolbar.js
diff --git a/remoting/webapp/me2mom/toolbar.js b/remoting/webapp/me2mom/toolbar.js
deleted file mode 100644
index 85ad48bb28feb59c04f1f22f99d34478e0a7d380..0000000000000000000000000000000000000000
--- a/remoting/webapp/me2mom/toolbar.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Class representing the client tool-bar.
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @param {Element} toolbar The HTML element representing the tool-bar.
- * @constructor
- */
-remoting.Toolbar = function(toolbar) {
- /**
- * @type {Element}
- * @private
- */
- this.toolbar_ = toolbar;
- /**
- * @type {boolean} False if the tool-bar is currently hidden, or should be
- * hidden once the over-shoot timer expires; true otherwise.
- */
- this.visible = false;
- /**
- * @type {number?} The id of the current timer, if any.
- */
- this.timerId = null;
-
- /** @type {remoting.Toolbar} */
- var that = this;
-
- /**
- * @param {Event} event The mouseout event, used to determine whether or
- * not the mouse is leaving the tool-bar or (due to event-bubbling)
- * one of its children.
- */
- var onMouseOut = function(event) {
- for (var e = event.toElement; e != null; e = e.parentElement) {
- if (e == that.toolbar_) {
- return; // Still over a child element => ignore.
- }
- }
- that.hide_();
- };
- this.toolbar_.onmouseout = onMouseOut;
-
- this.toolbar_.onmouseover = function() {
- that.showForAtLeast_(1000);
- };
-
- window.addEventListener('resize', function() { that.center(); }, false);
-};
-
-/**
- * Preview the tool-bar functionality by showing it for 3s if it is not
- * already visible.
- * @return {void} Nothing.
- */
-remoting.Toolbar.prototype.preview = function() {
- this.showForAtLeast_(3000);
- this.visible = false;
-};
-
-/**
- * Center the tool-bar horizonally.
- */
-remoting.Toolbar.prototype.center = function() {
- var toolbarX = (window.innerWidth - this.toolbar_.clientWidth) / 2;
- this.toolbar_.style['left'] = toolbarX + 'px';
-};
-
-/**
- * If the tool-bar is not currently visible, show it and start a timer to
- * prevent it from being hidden again for a short time. This is to guard
- * against users over-shooting the tool-bar stub when trying to access it.
- *
- * @param {number} timeout The minimum length of time, in ms, for which to
- * show the tool-bar. If the hide_() method is called within this time,
- * it will not take effect until the timeout expires.
- * @return {void} Nothing.
- * @private
- */
-remoting.Toolbar.prototype.showForAtLeast_ = function(timeout) {
- if (this.visible) {
- return;
- }
- addClass(this.toolbar_, remoting.Toolbar.VISIBLE_CLASS_);
- this.visible = true;
- if (this.timerId) {
- window.clearTimeout(this.timerId);
- this.timerId = null;
- }
- /** @type {remoting.Toolbar} */
- var that = this;
- var checkVisibility = function() { that.checkVisibility_(); };
- this.timerId = window.setTimeout(checkVisibility, timeout);
-};
-
-/**
- * Hide the tool-bar if it is visible. If there is a visibility timer running,
- * the tool-bar will not be hidden until it expires.
- *
- * @return {void} Nothing.
- * @private
- */
-remoting.Toolbar.prototype.hide_ = function() {
- if (!this.visible) {
- return;
- }
- this.visible = false;
- if (!this.timerId) {
- this.checkVisibility_();
- }
-};
-
-/**
- * Hide the tool-bar if it is visible and should not be.
- *
- * @return {void} Nothing.
- * @private
- */
-remoting.Toolbar.prototype.checkVisibility_ = function() {
- this.timerId = null;
- if (!this.visible) {
- removeClass(this.toolbar_, remoting.Toolbar.VISIBLE_CLASS_);
- }
-};
-
-/** @type {remoting.Toolbar} */
-remoting.toolbar = null;
-
-/** @private */
-remoting.Toolbar.VISIBLE_CLASS_ = 'toolbar-visible';
« no previous file with comments | « remoting/webapp/me2mom/toolbar.css ('k') | remoting/webapp/me2mom/ui_mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698