| 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/debugger_ui.h" | 8 #include "chrome/browser/dom_ui/debugger_ui.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 21 matching lines...) Expand all Loading... |
| 32 i != g_extra_types->end(); ++i) { | 32 i != g_extra_types->end(); ++i) { |
| 33 type = std::max(type, static_cast<int>(i->first)); | 33 type = std::max(type, static_cast<int>(i->first)); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 return static_cast<TabContentsType>(type + 1); | 36 return static_cast<TabContentsType>(type + 1); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // static | 39 // static |
| 40 TabContents* TabContents::CreateWithType(TabContentsType type, | 40 TabContents* TabContents::CreateWithType(TabContentsType type, |
| 41 Profile* profile, | 41 Profile* profile, |
| 42 SiteInstance* instance, | 42 SiteInstance* instance) { |
| 43 RenderViewHostFactory* rvh_factory) { | |
| 44 TabContents* contents = NULL; | 43 TabContents* contents = NULL; |
| 45 | 44 |
| 46 switch (type) { | 45 switch (type) { |
| 47 case TAB_CONTENTS_WEB: | 46 case TAB_CONTENTS_WEB: |
| 48 contents = new WebContents(profile, instance, rvh_factory, | 47 contents = new WebContents(profile, instance, MSG_ROUTING_NONE, NULL); |
| 49 MSG_ROUTING_NONE, NULL); | |
| 50 break; | 48 break; |
| 51 default: | 49 default: |
| 52 if (g_extra_types) { | 50 if (g_extra_types) { |
| 53 TabContentsFactoryMap::const_iterator it = g_extra_types->find(type); | 51 TabContentsFactoryMap::const_iterator it = g_extra_types->find(type); |
| 54 if (it != g_extra_types->end()) { | 52 if (it != g_extra_types->end()) { |
| 55 contents = it->second->CreateInstance(); | 53 contents = it->second->CreateInstance(); |
| 56 break; | 54 break; |
| 57 } | 55 } |
| 58 } | 56 } |
| 59 NOTREACHED() << "Don't know how to create tab contents of type " << type; | 57 NOTREACHED() << "Don't know how to create tab contents of type " << type; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } else { | 110 } else { |
| 113 g_extra_types->erase(type); | 111 g_extra_types->erase(type); |
| 114 if (g_extra_types->empty()) { | 112 if (g_extra_types->empty()) { |
| 115 delete g_extra_types; | 113 delete g_extra_types; |
| 116 g_extra_types = NULL; | 114 g_extra_types = NULL; |
| 117 } | 115 } |
| 118 } | 116 } |
| 119 | 117 |
| 120 return prev_factory; | 118 return prev_factory; |
| 121 } | 119 } |
| OLD | NEW |