summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/new_tab_ui.h
blob: fde0fe2efdc256fc98b33a0560ef7346ec0b38b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2006-2008 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 CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_
#define CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_

#include "chrome/browser/dom_ui/dom_ui.h"
#include "chrome/common/notification_registrar.h"

class GURL;
class PrefService;
class Profile;

namespace {
  class NewTabHTMLSource;
}

// The TabContents used for the New Tab page.
class NewTabUI : public DOMUI,
                 public NotificationObserver {
 public:
  explicit NewTabUI(TabContents* manager);
  ~NewTabUI();

  static void RegisterUserPrefs(PrefService* prefs);

  // Whether we should use the old new tab page.
  static bool UseOldNewTabPage();

  // Whether we should disable the web resources backend service
  static bool WebResourcesEnabled();

 private:
  void Observe(NotificationType type,
               const NotificationSource& source,
               const NotificationDetails& details);

  NotificationRegistrar registrar_;

  // The message id that should be displayed in this NewTabUIContents
  // instance's motd area.
  int motd_message_id_;

  // Whether the user is in incognito mode or not, used to determine
  // what HTML to load.
  bool incognito_;

  DISALLOW_COPY_AND_ASSIGN(NewTabUI);
};

#endif  // CHROME_BROWSER_DOM_UI_NEW_TAB_UI_H_