1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/ui/tab_dialogs.h" 6 7 #include "content/public/browser/web_contents.h" 8 9 namespace { 10 int kUserDataKey; // The value is not important, the address is a key. 11 } 12 13 // static FromWebContents(content::WebContents * contents)14TabDialogs* TabDialogs::FromWebContents(content::WebContents* contents) { 15 DCHECK(contents); 16 return static_cast<TabDialogs*>(contents->GetUserData(UserDataKey())); 17 } 18 19 // static UserDataKey()20const void* TabDialogs::UserDataKey() { 21 return &kUserDataKey; 22 } 23