<commit_before>// Copyright (c) 2011 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.

#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_
#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_

#include "content/browser/tab_contents/tab_contents_observer.h"

// Use this as a member variable in a class that uses the empty constructor
// version of this interface.  On destruction of TabContents being observed,
// the registrar must either be destroyed or explicitly set to observe
// another TabContents.
class TabContentsObserverRegistrar : public TabContentsObserver {
 public:
  explicit TabContentsObserverRegistrar(TabContentsObserver* observer);
  ~TabContentsObserverRegistrar();

  // Call this to start observing a tab.  Passing in NULL resets it.
  // This can only be used to watch one tab at a time.  If you call this and
  // you're already observing another tab, the old tab won't be observed
  // afterwards.
  void Observe(TabContents* tab);

 private:
  virtual void TabContentsDestroyed(TabContents* tab);

  TabContentsObserver* observer_;
  TabContents* tab_;

  DISALLOW_COPY_AND_ASSIGN(TabContentsObserverRegistrar);
};

#endif  // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_
<commit_msg>Fix clang<commit_after>// Copyright (c) 2011 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.

#ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_
#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_

#include "content/browser/tab_contents/tab_contents_observer.h"

// Use this as a member variable in a class that uses the empty constructor
// version of this interface.  On destruction of TabContents being observed,
// the registrar must either be destroyed or explicitly set to observe
// another TabContents.
class TabContentsObserverRegistrar : public TabContentsObserver {
 public:
  explicit TabContentsObserverRegistrar(TabContentsObserver* observer);
  virtual ~TabContentsObserverRegistrar();

  // Call this to start observing a tab.  Passing in NULL resets it.
  // This can only be used to watch one tab at a time.  If you call this and
  // you're already observing another tab, the old tab won't be observed
  // afterwards.
  void Observe(TabContents* tab);

 private:
  virtual void TabContentsDestroyed(TabContents* tab);

  TabContentsObserver* observer_;
  TabContents* tab_;

  DISALLOW_COPY_AND_ASSIGN(TabContentsObserverRegistrar);
};

#endif  // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_OBSERVER_REGISTRAR_H_

{'fraction_non_alphanumeric': 0.059854014598540145, 'fraction_numerical': 0.00291970802919708, 'mean_word_length': 5.050772626931567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7588704', 'n_tokens_mistral': 850, 'n_tokens_neox': 795, 'n_words': 276}