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 12 matching lines...) Expand all Loading... | |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
24 #include "content/public/browser/web_contents_view.h" | 24 #include "content/public/browser/web_contents_view.h" |
25 #include "content/shell/shell_browser_main_parts.h" | 25 #include "content/shell/shell_browser_main_parts.h" |
26 #include "content/shell/shell_content_browser_client.h" | 26 #include "content/shell/shell_content_browser_client.h" |
27 #include "content/shell/shell_devtools_delegate.h" | 27 #include "content/shell/shell_devtools_delegate.h" |
28 #include "content/shell/shell_javascript_dialog_creator.h" | 28 #include "content/shell/shell_javascript_dialog_creator.h" |
29 #include "content/shell/shell_messages.h" | 29 #include "content/shell/shell_messages.h" |
30 #include "content/shell/shell_switches.h" | 30 #include "content/shell/shell_switches.h" |
31 #include "content/shell/webkit_test_controller.h" | 31 #include "content/shell/webkit_test_controller.h" |
32 | 32 |
33 // Content area size for newly created windows. | 33 #if defined(USE_AURA) |
34 static const int kTestWindowWidth = 800; | 34 #include "content/shell/shell_stacking_client_ash.h" |
35 static const int kTestWindowHeight = 600; | 35 #endif |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 | 38 |
39 std::vector<Shell*> Shell::windows_; | 39 std::vector<Shell*> Shell::windows_; |
40 base::Callback<void(Shell*)> Shell::shell_created_callback_; | 40 base::Callback<void(Shell*)> Shell::shell_created_callback_; |
41 | 41 |
42 bool Shell::quit_message_loop_ = true; | 42 bool Shell::quit_message_loop_ = true; |
43 | 43 |
44 Shell::Shell(WebContents* web_contents) | 44 Shell::Shell(WebContents* web_contents) |
45 : dev_tools_(NULL), | 45 : dev_tools_(NULL), |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 } | 114 } |
115 } | 115 } |
116 return NULL; | 116 return NULL; |
117 } | 117 } |
118 | 118 |
119 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, | 119 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, |
120 const GURL& url, | 120 const GURL& url, |
121 SiteInstance* site_instance, | 121 SiteInstance* site_instance, |
122 int routing_id, | 122 int routing_id, |
123 const gfx::Size& initial_size) { | 123 const gfx::Size& initial_size) { |
124 WebContents::CreateParams create_params(browser_context, site_instance); | 124 WebContents::CreateParams create_params( |
125 browser_context, site_instance); | |
sky
2013/01/16 00:55:39
Why are you changing this?
Nayan
2013/01/16 01:07:29
Done.
| |
125 create_params.routing_id = routing_id; | 126 create_params.routing_id = routing_id; |
126 if (!initial_size.IsEmpty()) | 127 if (!initial_size.IsEmpty()) |
127 create_params.initial_size = initial_size; | 128 create_params.initial_size = initial_size; |
128 else | 129 else |
129 create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); | 130 create_params.initial_size = |
131 gfx::Size(kTestWindowWidth, kTestWindowHeight); | |
sky
2013/01/16 00:55:39
Why are you changing this line?
Nayan
2013/01/16 01:07:29
Done.
| |
132 create_params.context = Shell::stacking_client_->GetDefaultParent( | |
sky
2013/01/16 00:55:39
This is aura specific, right?
Nayan
2013/01/16 01:07:29
Done.
| |
133 NULL, NULL, gfx::Rect()); | |
130 WebContents* web_contents = WebContents::Create(create_params); | 134 WebContents* web_contents = WebContents::Create(create_params); |
131 Shell* shell = CreateShell(web_contents); | 135 Shell* shell = CreateShell(web_contents); |
132 if (!url.is_empty()) | 136 if (!url.is_empty()) |
133 shell->LoadURL(url); | 137 shell->LoadURL(url); |
134 return shell; | 138 return shell; |
135 } | 139 } |
136 | 140 |
137 void Shell::LoadURL(const GURL& url) { | 141 void Shell::LoadURL(const GURL& url) { |
138 web_contents_->GetController().LoadURL( | 142 web_contents_->GetController().LoadURL( |
139 url, | 143 url, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 302 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
299 | 303 |
300 if (title->first) { | 304 if (title->first) { |
301 string16 text = title->first->GetTitle(); | 305 string16 text = title->first->GetTitle(); |
302 PlatformSetTitle(text); | 306 PlatformSetTitle(text); |
303 } | 307 } |
304 } | 308 } |
305 } | 309 } |
306 | 310 |
307 } // namespace content | 311 } // namespace content |
OLD | NEW |