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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 else | 140 else |
141 create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); | 141 create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight); |
142 WebContents* web_contents = WebContents::Create(create_params); | 142 WebContents* web_contents = WebContents::Create(create_params); |
143 Shell* shell = CreateShell(web_contents); | 143 Shell* shell = CreateShell(web_contents); |
144 if (!url.is_empty()) | 144 if (!url.is_empty()) |
145 shell->LoadURL(url); | 145 shell->LoadURL(url); |
146 return shell; | 146 return shell; |
147 } | 147 } |
148 | 148 |
149 void Shell::LoadURL(const GURL& url) { | 149 void Shell::LoadURL(const GURL& url) { |
150 web_contents_->GetController().LoadURL( | 150 LoadURLForFrame(url, std::string()); |
151 url, | 151 } |
152 Referrer(), | 152 |
153 PageTransitionFromInt(PAGE_TRANSITION_TYPED | | 153 void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) { |
154 PAGE_TRANSITION_FROM_ADDRESS_BAR), | 154 NavigationController::LoadURLParams params(url); |
155 std::string()); | 155 params.transition_type = PageTransitionFromInt( |
| 156 PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR); |
| 157 params.frame_name = frame_name; |
| 158 web_contents_->GetController().LoadURLWithParams(params); |
156 web_contents_->Focus(); | 159 web_contents_->Focus(); |
157 } | 160 } |
158 | 161 |
159 void Shell::GoBackOrForward(int offset) { | 162 void Shell::GoBackOrForward(int offset) { |
160 web_contents_->GetController().GoToOffset(offset); | 163 web_contents_->GetController().GoToOffset(offset); |
161 web_contents_->Focus(); | 164 web_contents_->Focus(); |
162 } | 165 } |
163 | 166 |
164 void Shell::Reload() { | 167 void Shell::Reload() { |
165 web_contents_->GetController().Reload(false); | 168 web_contents_->GetController().Reload(false); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); | 296 Details<std::pair<NavigationEntry*, bool> >(details).ptr(); |
294 | 297 |
295 if (title->first) { | 298 if (title->first) { |
296 string16 text = title->first->GetTitle(); | 299 string16 text = title->first->GetTitle(); |
297 PlatformSetTitle(text); | 300 PlatformSetTitle(text); |
298 } | 301 } |
299 } | 302 } |
300 } | 303 } |
301 | 304 |
302 } // namespace content | 305 } // namespace content |
OLD | NEW |