Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/tab_contents/tab_contents_factory.cc

Issue 18728: Create a dialog box for the about:network view and kill the tab type.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/html_dialog_contents.h" 9 #include "chrome/browser/dom_ui/html_dialog_contents.h"
10 #include "chrome/browser/dom_ui/new_tab_ui.h" 10 #include "chrome/browser/dom_ui/new_tab_ui.h"
11 #include "chrome/browser/profile.h" 11 #include "chrome/browser/profile.h"
12 #include "chrome/browser/renderer_host/render_process_host.h" 12 #include "chrome/browser/renderer_host/render_process_host.h"
13 #include "chrome/browser/debugger/debugger_contents.h" 13 #include "chrome/browser/debugger/debugger_contents.h"
14 #include "chrome/browser/tab_contents/ipc_status_view.h" 14 #include "chrome/browser/tab_contents/ipc_status_view.h"
15 #include "chrome/browser/tab_contents/native_ui_contents.h" 15 #include "chrome/browser/tab_contents/native_ui_contents.h"
16 #include "chrome/browser/tab_contents/network_status_view.h"
17 #include "chrome/browser/tab_contents/tab_contents.h" 16 #include "chrome/browser/tab_contents/tab_contents.h"
18 #include "chrome/browser/tab_contents/tab_contents_factory.h" 17 #include "chrome/browser/tab_contents/tab_contents_factory.h"
19 #include "chrome/browser/tab_contents/view_source_contents.h" 18 #include "chrome/browser/tab_contents/view_source_contents.h"
20 #include "chrome/browser/tab_contents/web_contents.h" 19 #include "chrome/browser/tab_contents/web_contents.h"
21 #include "net/base/net_util.h" 20 #include "net/base/net_util.h"
22 21
23 typedef std::map<TabContentsType, TabContentsFactory*> TabContentsFactoryMap; 22 typedef std::map<TabContentsType, TabContentsFactory*> TabContentsFactoryMap;
24 static TabContentsFactoryMap* g_extra_types; // Only allocated if needed. 23 static TabContentsFactoryMap* g_extra_types; // Only allocated if needed.
25 24
26 // static 25 // static
(...skipping 11 matching lines...) Expand all
38 /*static*/ 37 /*static*/
39 TabContents* TabContents::CreateWithType(TabContentsType type, 38 TabContents* TabContents::CreateWithType(TabContentsType type,
40 Profile* profile, 39 Profile* profile,
41 SiteInstance* instance) { 40 SiteInstance* instance) {
42 TabContents* contents; 41 TabContents* contents;
43 42
44 switch (type) { 43 switch (type) {
45 case TAB_CONTENTS_WEB: 44 case TAB_CONTENTS_WEB:
46 contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL ); 45 contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL );
47 break; 46 break;
48 case TAB_CONTENTS_NETWORK_STATUS_VIEW:
49 contents = new NetworkStatusView();
50 break;
51 #ifdef IPC_MESSAGE_LOG_ENABLED 47 #ifdef IPC_MESSAGE_LOG_ENABLED
52 case TAB_CONTENTS_IPC_STATUS_VIEW: 48 case TAB_CONTENTS_IPC_STATUS_VIEW:
53 contents = new IPCStatusView(); 49 contents = new IPCStatusView();
54 break; 50 break;
55 #endif 51 #endif
56 case TAB_CONTENTS_NEW_TAB_UI: 52 case TAB_CONTENTS_NEW_TAB_UI:
57 contents = new NewTabUIContents(profile, instance, NULL); 53 contents = new NewTabUIContents(profile, instance, NULL);
58 break; 54 break;
59 case TAB_CONTENTS_HTML_DIALOG: 55 case TAB_CONTENTS_HTML_DIALOG:
60 contents = new HtmlDialogContents(profile, instance, NULL); 56 contents = new HtmlDialogContents(profile, instance, NULL);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 g_extra_types->erase(type); 144 g_extra_types->erase(type);
149 if (g_extra_types->empty()) { 145 if (g_extra_types->empty()) {
150 delete g_extra_types; 146 delete g_extra_types;
151 g_extra_types = NULL; 147 g_extra_types = NULL;
152 } 148 }
153 } 149 }
154 150
155 return prev_factory; 151 return prev_factory;
156 } 152 }
157 153
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698