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

Side by Side Diff: content/shell/shell.cc

Issue 11614037: Call ShowRootWindow on NativeWindow's RootWindow to display the window. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Create RootWindowFirst Created 7 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
OLDNEW
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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(browser_context, site_instance);
125 create_params.routing_id = routing_id; 125 create_params.routing_id = routing_id;
126 if (!initial_size.IsEmpty()) 126 if (!initial_size.IsEmpty())
127 create_params.initial_size = initial_size; 127 create_params.initial_size = initial_size;
128 else 128 else
129 create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); 129 create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight);
130 create_params.context = Shell::stacking_client_->GetDefaultParent(NULL, NULL, gfx::Rect());
sky 2013/01/15 21:53:49 > 80
Nayan 2013/01/15 23:39:03 Done.
130 WebContents* web_contents = WebContents::Create(create_params); 131 WebContents* web_contents = WebContents::Create(create_params);
131 Shell* shell = CreateShell(web_contents); 132 Shell* shell = CreateShell(web_contents);
132 if (!url.is_empty()) 133 if (!url.is_empty())
133 shell->LoadURL(url); 134 shell->LoadURL(url);
134 return shell; 135 return shell;
135 } 136 }
136 137
137 void Shell::LoadURL(const GURL& url) { 138 void Shell::LoadURL(const GURL& url) {
138 web_contents_->GetController().LoadURL( 139 web_contents_->GetController().LoadURL(
139 url, 140 url,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); 299 Details<std::pair<NavigationEntry*, bool> >(details).ptr();
299 300
300 if (title->first) { 301 if (title->first) {
301 string16 text = title->first->GetTitle(); 302 string16 text = title->first->GetTitle();
302 PlatformSetTitle(text); 303 PlatformSetTitle(text);
303 } 304 }
304 } 305 }
305 } 306 }
306 307
307 } // namespace content 308 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698