| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/shell/shell.h" | 5 #include "content/shell/shell.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { | 119 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { |
| 120 for (size_t i = 0; i < windows_.size(); ++i) { | 120 for (size_t i = 0; i < windows_.size(); ++i) { |
| 121 if (windows_[i]->web_contents() && | 121 if (windows_[i]->web_contents() && |
| 122 windows_[i]->web_contents()->GetRenderViewHost() == rvh) { | 122 windows_[i]->web_contents()->GetRenderViewHost() == rvh) { |
| 123 return windows_[i]; | 123 return windows_[i]; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 return NULL; | 126 return NULL; |
| 127 } | 127 } |
| 128 | 128 |
| 129 // static |
| 130 void Shell::Initialize() { |
| 131 PlatformInitialize(gfx::Size(kTestWindowWidth, kTestWindowHeight)); |
| 132 } |
| 133 |
| 129 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, | 134 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, |
| 130 const GURL& url, | 135 const GURL& url, |
| 131 SiteInstance* site_instance, | 136 SiteInstance* site_instance, |
| 132 int routing_id, | 137 int routing_id, |
| 133 const gfx::Size& initial_size) { | 138 const gfx::Size& initial_size) { |
| 134 WebContents::CreateParams create_params(browser_context, site_instance); | 139 WebContents::CreateParams create_params(browser_context, site_instance); |
| 135 create_params.routing_id = routing_id; | 140 create_params.routing_id = routing_id; |
| 136 if (!initial_size.IsEmpty()) | 141 if (!initial_size.IsEmpty()) |
| 137 create_params.initial_size = initial_size; | 142 create_params.initial_size = initial_size; |
| 138 else | 143 else |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 315 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
| 311 | 316 |
| 312 if (title->first) { | 317 if (title->first) { |
| 313 string16 text = title->first->GetTitle(); | 318 string16 text = title->first->GetTitle(); |
| 314 PlatformSetTitle(text); | 319 PlatformSetTitle(text); |
| 315 } | 320 } |
| 316 } | 321 } |
| 317 } | 322 } |
| 318 | 323 |
| 319 } // namespace content | 324 } // namespace content |
| OLD | NEW |