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

Side by Side Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 1169323004: DevTools: do not respect Chrome theme in DevTools, align toolbar items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: overflow for tab header fixed. Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 WebInspector._previousFocusElement.blur(); 755 WebInspector._previousFocusElement.blur();
756 } 756 }
757 757
758 WebInspector.restoreFocusFromElement = function(element) 758 WebInspector.restoreFocusFromElement = function(element)
759 { 759 {
760 if (element && element.isSelfOrAncestor(WebInspector.currentFocusElement())) 760 if (element && element.isSelfOrAncestor(WebInspector.currentFocusElement()))
761 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement()) ; 761 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement()) ;
762 } 762 }
763 763
764 /** 764 /**
765 * @param {!Document} document
766 * @param {string} backgroundColor
767 * @param {string} color
768 */
769 WebInspector.setToolbarColors = function(document, backgroundColor, color)
770 {
771 if (!WebInspector._themeStyleElement) {
772 WebInspector._themeStyleElement = createElement("style");
773 document.head.appendChild(WebInspector._themeStyleElement);
774 }
775 var colorWithAlpha = WebInspector.Color.parse(color).setAlpha(0.9).asString( WebInspector.Color.Format.RGBA);
776 var prefix = WebInspector.isMac() ? "body:not(.undocked)" : "body";
777 WebInspector._themeStyleElement.textContent =
778 String.sprintf(
779 "%s .inspector-view-tabbed-pane.tabbed-pane::shadow .tabbed-pane-hea der {" +
780 " background-image: none !important;" +
781 " background-color: %s !important;" +
782 " color: %s !important;" +
783 "}", prefix, backgroundColor, colorWithAlpha) +
784 String.sprintf(
785 "%s .inspector-view-tabbed-pane.tabbed-pane::shadow .tabbed-pane-hea der-tab:hover {" +
786 " color: %s;" +
787 "}", prefix, color) +
788 String.sprintf(
789 "%s .inspector-view-toolbar.toolbar::shadow .toolbar-item {" +
790 " color: %s;" +
791 "}", prefix, colorWithAlpha) +
792 String.sprintf(
793 "%s .inspector-view-toolbar.toolbar::shadow .toolbar-button-theme { " +
794 " background-color: %s;" +
795 "}", prefix, colorWithAlpha);
796 }
797
798 WebInspector.resetToolbarColors = function()
799 {
800 if (WebInspector._themeStyleElement)
801 WebInspector._themeStyleElement.textContent = "";
802 }
803
804 /**
805 * @param {!Element} element 765 * @param {!Element} element
806 * @param {number} offset 766 * @param {number} offset
807 * @param {number} length 767 * @param {number} length
808 * @param {!Array.<!Object>=} domChanges 768 * @param {!Array.<!Object>=} domChanges
809 * @return {?Element} 769 * @return {?Element}
810 */ 770 */
811 WebInspector.highlightSearchResult = function(element, offset, length, domChange s) 771 WebInspector.highlightSearchResult = function(element, offset, length, domChange s)
812 { 772 {
813 var result = WebInspector.highlightSearchResults(element, [new WebInspector. SourceRange(offset, length)], domChanges); 773 var result = WebInspector.highlightSearchResults(element, [new WebInspector. SourceRange(offset, length)], domChanges);
814 return result.length ? result[0] : null; 774 return result.length ? result[0] : null;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 // Due to the nature of regex, |items| array has matched elements on its even indexes. 1443 // Due to the nature of regex, |items| array has matched elements on its even indexes.
1484 var items = text.replace(regex, "\0$1\0").split("\0"); 1444 var items = text.replace(regex, "\0$1\0").split("\0");
1485 for (var i = 0; i < items.length; ++i) { 1445 for (var i = 0; i < items.length; ++i) {
1486 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor (processorIndex + 1, items[i]); 1446 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor (processorIndex + 1, items[i]);
1487 container.appendChild(processedNode); 1447 container.appendChild(processedNode);
1488 } 1448 }
1489 1449
1490 return container; 1450 return container;
1491 } 1451 }
1492 } 1452 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/timelinePanel.css ('k') | Source/devtools/front_end/ui/filter.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698