Another more passive way to do this is not to rely on volunteers to participate in class. I like to have students volunteer to answer questions and participate. However, this generally favors extroverts and gets hardworking introverts off the hook simply because they are not inclined to speak up (not to mention the generally lazy students who would much rather spend time on Facebook or anything else but class--they are not necessarily lazy, I suppose, but it doesn't do them any favors to appear disengaged). Despite these problems, it's the less threatening option. In other words, if I instead always chose participants at random, more people would realize they have to stay on their toes (or suffer embarrassment as they are called on and they cannot even give a wrong answer but must stammer and be flustered and go: "Huh? What were we talking about?"). I struggle with this idea a lot and try to maintain a balance where students do not feel too much pressure or anxiety--and there are days I require everyone to participate because it simply must be done.
Regarding the act of telling students off, I'm not sure it will really do any good in the long run.
Perhaps my attitude is too fatalistic: I see chronic web browsing during class to be somewhat of an addiction for some students. In other words, I don't know if knowledge alone will help them. For example, a person can have an obvious weight problem and show up to class with a chocolate chip muffin every day, and we can tell him, "Hey, don't you know you're at risk for heart disease and diabetes with that daily sugar cake there?" In a perfect world, the person would go, "Oh my! You're right!" Then he'd throw his muffin in the trash, get a gym membership, maybe even join a support group for compulsive eaters, and be on his way to breaking a lifelong destructive cycle. However, the reality is the person will probably just resent your comment and see it as intrusive, since based on his behavior, he likely doesn't imagine his behavior is an actual problem. Likely this will lead to more blatant shows of rebellion ("More muffins!" i.e. more web browsing), or it will lead to more discreet and shame-driven hiding ("I'm just going to cut this muffin into pieces and small bites and hide it in my backpack so I can eat them more quickly and stealthily so no one can make me feel bad for my behavior," i.e. more stealthy ways of web browsing).
The funny thing is, when I worked as a writing consultant, one of my coworkers sitting next to me at a staff meeting asked me why I was eating such a large chocolate chip muffin all by myself. She followed this with an assertion that I would eventually get diabetes. I told her thanks and then put my muffin into my coat pocket, and I ate it on the way back home when I was free from the Lidless Anti-Muffin Eye of Sauron that so pricked my conscience in the conversation.
On the first day of class, I tell students about the value of note-taking and how increased social media is associated with lower GPAs and all that jazz. However, I also know that information alone is often not enough. People usually don't stop destructive behaviors until they start suffering natural consequences and start asking the hard questions of "man, what am I doing wrong here?" For some students, they might realize they aren't paying enough attention when they get their first grades back and realize: "Uh oh! I'm not paying enough attention!" Or they might manage to squeak by and then feel more emboldened to continue their behavior.
The takeaway for teachers is to look inward and ask hard questions of ourselves: What are we doing to contribute to off-task behavior? Is our approach too boring and thus inviting off-task behavior? Have we somehow disrespected a particular student who is showing a kind of civil disobedience to usurp our authority? Does our participation model invite extroverts to participate and introverts to stay quiet?
Man, I'm not even hungry, but I want a chocolate chip muffin now.
-Bill