core_tab_helper_delegate.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 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#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_
6#define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_
7
8#include "base/basictypes.h"
9
10namespace content {
11class WebContents;
12}
13
14// Objects implement this interface to get notified about changes in a
15// WebContents and to provide necessary functionality.
16//
17// This is the catch-all interface for holding additions to WebContents that are
18// needed when a WebContents is promoted to being a tab contents, but that
19// don't cleanly fit elsewhere.
20class CoreTabHelperDelegate {
21 public:
22  // The caller is responsible for deleting |old_contents|.
23  virtual void SwapTabContents(content::WebContents* old_contents,
24                               content::WebContents* new_contents);
25
26  // Whether the specified WebContents can be reloaded.
27  // Reloading can be disabled e.g. for the DevTools window.
28  virtual bool CanReloadContents(content::WebContents* web_contents) const;
29
30  // Whether the specified WebContents can be saved.
31  // Saving can be disabled e.g. for the DevTools window.
32  virtual bool CanSaveContents(content::WebContents* web_contents) const;
33
34 protected:
35  virtual ~CoreTabHelperDelegate();
36};
37
38#endif  // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_
39