summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/tab_dialogs.cc
blob: 64c656935377739f1582fccc99cce3a3734a060c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/tab_dialogs.h"
#include "content/public/browser/web_contents.h"

namespace {
int kUserDataKey;  // The value is not important, the address is a key.
}

// static
TabDialogs* TabDialogs::FromWebContents(content::WebContents* contents) {
  DCHECK(contents);
  return static_cast<TabDialogs*>(contents->GetUserData(UserDataKey()));
}

// static
const void* TabDialogs::UserDataKey() {
  return &kUserDataKey;
}