OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/string_util.h" | 5 #include "base/string_util.h" |
6 #include "chrome/browser/browser_about_handler.h" | 6 #include "chrome/browser/browser_about_handler.h" |
7 #include "chrome/browser/browser_url_handler.h" | 7 #include "chrome/browser/browser_url_handler.h" |
8 #include "chrome/browser/dom_ui/dom_ui_contents.h" | 8 #include "chrome/browser/dom_ui/dom_ui_contents.h" |
9 #include "chrome/browser/dom_ui/new_tab_ui.h" | 9 #include "chrome/browser/dom_ui/new_tab_ui.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 SiteInstance* instance) { | 45 SiteInstance* instance) { |
46 TabContents* contents = NULL; | 46 TabContents* contents = NULL; |
47 | 47 |
48 switch (type) { | 48 switch (type) { |
49 case TAB_CONTENTS_WEB: | 49 case TAB_CONTENTS_WEB: |
50 contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL
); | 50 contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL
); |
51 break; | 51 break; |
52 // TODO(port): remove this platform define, either by porting the tab contents | 52 // TODO(port): remove this platform define, either by porting the tab contents |
53 // types or removing them completely. | 53 // types or removing them completely. |
54 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
55 case TAB_CONTENTS_NEW_TAB_UI: | |
56 contents = new NewTabUIContents(profile, instance, NULL); | |
57 break; | |
58 case TAB_CONTENTS_HTML_DIALOG: | 55 case TAB_CONTENTS_HTML_DIALOG: |
59 contents = new HtmlDialogContents(profile, instance, NULL); | 56 contents = new HtmlDialogContents(profile, instance, NULL); |
60 break; | 57 break; |
61 case TAB_CONTENTS_NATIVE_UI: | 58 case TAB_CONTENTS_NATIVE_UI: |
62 contents = new NativeUIContents(profile); | 59 contents = new NativeUIContents(profile); |
63 break; | 60 break; |
64 case TAB_CONTENTS_VIEW_SOURCE: | 61 case TAB_CONTENTS_VIEW_SOURCE: |
65 contents = new ViewSourceContents(profile, instance); | 62 contents = new ViewSourceContents(profile, instance); |
66 break; | 63 break; |
67 case TAB_CONTENTS_ABOUT_UI: | 64 case TAB_CONTENTS_ABOUT_UI: |
68 contents = new BrowserAboutHandler(profile, instance, NULL); | 65 contents = new BrowserAboutHandler(profile, instance, NULL); |
69 break; | 66 break; |
70 case TAB_CONTENTS_DEBUGGER: | 67 case TAB_CONTENTS_DEBUGGER: |
71 contents = new DebuggerContents(profile, instance); | 68 case TAB_CONTENTS_NEW_TAB_UI: |
72 break; | |
73 case TAB_CONTENTS_DOM_UI: | 69 case TAB_CONTENTS_DOM_UI: |
74 contents = new DOMUIContents(profile, instance, NULL); | 70 contents = new DOMUIContents(profile, instance, NULL); |
75 break; | 71 break; |
76 #endif // defined(OS_WIN) | 72 #endif // defined(OS_WIN) |
77 default: | 73 default: |
78 if (g_extra_types) { | 74 if (g_extra_types) { |
79 TabContentsFactoryMap::const_iterator it = g_extra_types->find(type); | 75 TabContentsFactoryMap::const_iterator it = g_extra_types->find(type); |
80 if (it != g_extra_types->end()) { | 76 if (it != g_extra_types->end()) { |
81 contents = it->second->CreateInstance(); | 77 contents = it->second->CreateInstance(); |
82 break; | 78 break; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 g_extra_types->erase(type); | 149 g_extra_types->erase(type); |
154 if (g_extra_types->empty()) { | 150 if (g_extra_types->empty()) { |
155 delete g_extra_types; | 151 delete g_extra_types; |
156 g_extra_types = NULL; | 152 g_extra_types = NULL; |
157 } | 153 } |
158 } | 154 } |
159 | 155 |
160 return prev_factory; | 156 return prev_factory; |
161 } | 157 } |
162 | 158 |
OLD | NEW |