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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { | 117 Shell* Shell::FromRenderViewHost(RenderViewHost* rvh) { |
118 for (size_t i = 0; i < windows_.size(); ++i) { | 118 for (size_t i = 0; i < windows_.size(); ++i) { |
119 if (windows_[i]->web_contents() && | 119 if (windows_[i]->web_contents() && |
120 windows_[i]->web_contents()->GetRenderViewHost() == rvh) { | 120 windows_[i]->web_contents()->GetRenderViewHost() == rvh) { |
121 return windows_[i]; | 121 return windows_[i]; |
122 } | 122 } |
123 } | 123 } |
124 return NULL; | 124 return NULL; |
125 } | 125 } |
126 | 126 |
| 127 // static |
| 128 void Shell::Initialize() { |
| 129 PlatformInitialize(gfx::Size(kTestWindowWidth, kTestWindowHeight)); |
| 130 } |
| 131 |
127 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, | 132 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, |
128 const GURL& url, | 133 const GURL& url, |
129 SiteInstance* site_instance, | 134 SiteInstance* site_instance, |
130 int routing_id, | 135 int routing_id, |
131 const gfx::Size& initial_size) { | 136 const gfx::Size& initial_size) { |
132 WebContents::CreateParams create_params(browser_context, site_instance); | 137 WebContents::CreateParams create_params(browser_context, site_instance); |
133 create_params.routing_id = routing_id; | 138 create_params.routing_id = routing_id; |
134 if (!initial_size.IsEmpty()) | 139 if (!initial_size.IsEmpty()) |
135 create_params.initial_size = initial_size; | 140 create_params.initial_size = initial_size; |
136 else | 141 else |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 304 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
300 | 305 |
301 if (title->first) { | 306 if (title->first) { |
302 string16 text = title->first->GetTitle(); | 307 string16 text = title->first->GetTitle(); |
303 PlatformSetTitle(text); | 308 PlatformSetTitle(text); |
304 } | 309 } |
305 } | 310 } |
306 } | 311 } |
307 | 312 |
308 } // namespace content | 313 } // namespace content |
OLD | NEW |