Are professors' salaries a function of the amount of grant funding they obtain? Some professors direct large research programs. What is the typical practice for compensating them?

For example, it is not unusual for a top professor to be directing $30 million in research grants every year. If the professor got only 1% of this, it would be a salary of $300,000 per year. I would assume they are paid more than that.

Please do not answer vaguely (impossible to know, it differs from place to place). Obviously, it differs from place to place. I want to know the general and typical practices. What is a common method of compensation.

I am just interested here in compensation for grant-making ability. So, if that is a factor in salary, I would like to know the effect on salary.
In the United States, the amount of money that a professor makes is not generally a percentage of the amount of funding that they have under management.  Instead, professors are typically guaranteed a 9-month salary and can supplement with 3 additional grant-funded months (generally at the same rate) for summer.  That salary is set by a combination of regulation, negotiation, and academic rank, in a manner vaguely similar to salaries at a large corporation.  

Thus, high funding correlates with high salary because a well-funded professor is also likely to be progressing in their compensation package, but there is typically an effective "cap" on the amount that a professor can receive through their university (consulting, startups, and patent licensing fees may be an entirely different matter, but again are not actually determined by research funding, just correlated as being another common product of a successful research).

As for the actual compensation of specific faculty: for most US state-funded institutions, you can find complete salary databases published as public records.  For example, here is one for Berkeley.  Private institutions have relatively similar compensation rates (or a bit higher), since top private institutions are competing with top public institutions for the same talent.