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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2748023006: [DevTools] Make ConsoleModel not inherit from SDKModel (Closed)
Patch Set: stray change Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 */ 630 */
631 _updateItem(item, count, first, title) { 631 _updateItem(item, count, first, title) {
632 item.item.classList.toggle('hidden', !count); 632 item.item.classList.toggle('hidden', !count);
633 item.item.classList.toggle('counter-item-first', first); 633 item.item.classList.toggle('counter-item-first', first);
634 item.text.textContent = count; 634 item.text.textContent = count;
635 if (count) 635 if (count)
636 this._titles.push(title); 636 this._titles.push(title);
637 } 637 }
638 638
639 _update() { 639 _update() {
640 var errors = 0; 640 var errors = SDK.multitargetConsoleModel.errors();
641 var warnings = 0; 641 var warnings = SDK.multitargetConsoleModel.warnings();
642 var targets = SDK.targetManager.targets();
643 for (var i = 0; i < targets.length; ++i) {
644 errors += targets[i].consoleModel.errors();
645 warnings += targets[i].consoleModel.warnings();
646 }
647 642
648 this._titles = []; 643 this._titles = [];
649 this._toolbarItem.setVisible(!!(errors || warnings)); 644 this._toolbarItem.setVisible(!!(errors || warnings));
650 this._updateItem(this._errors, errors, false, Common.UIString(errors === 1 ? '%d error' : '%d errors', errors)); 645 this._updateItem(this._errors, errors, false, Common.UIString(errors === 1 ? '%d error' : '%d errors', errors));
651 this._updateItem( 646 this._updateItem(
652 this._warnings, warnings, !errors, Common.UIString(warnings === 1 ? '%d warning' : '%d warnings', warnings)); 647 this._warnings, warnings, !errors, Common.UIString(warnings === 1 ? '%d warning' : '%d warnings', warnings));
653 this._counter.title = this._titles.join(', '); 648 this._counter.title = this._titles.join(', ');
654 UI.inspectorView.toolbarItemResized(); 649 UI.inspectorView.toolbarItemResized();
655 } 650 }
656 651
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 * @override 952 * @override
958 * @return {?Element} 953 * @return {?Element}
959 */ 954 */
960 settingElement() { 955 settingElement() {
961 return UI.SettingsUI.createSettingCheckbox( 956 return UI.SettingsUI.createSettingCheckbox(
962 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 957 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
963 } 958 }
964 }; 959 };
965 960
966 new Main.Main(); 961 new Main.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698