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 "chrome/browser/chromeos/login/registration_screen.h" | 5 #include "chrome/browser/chromeos/login/registration_screen.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
11 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
14 #include "content/browser/child_process_security_policy.h" | 14 #include "content/browser/child_process_security_policy.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/site_instance.h" | 16 #include "content/public/browser/site_instance.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
19 #include "net/url_request/url_request_about_job.h" | 19 #include "net/url_request/url_request_about_job.h" |
20 #include "net/url_request/url_request_filter.h" | 20 #include "net/url_request/url_request_filter.h" |
21 | 21 |
22 using content::OpenURLParams; | 22 using content::OpenURLParams; |
| 23 using content::SiteInstance; |
23 using content::WebContents; | 24 using content::WebContents; |
24 | 25 |
25 namespace chromeos { | 26 namespace chromeos { |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 const char kRegistrationHostPageUrl[] = "chrome://register/"; | 30 const char kRegistrationHostPageUrl[] = "chrome://register/"; |
30 | 31 |
31 // "Hostname" that is used for redirects from host registration page. | 32 // "Hostname" that is used for redirects from host registration page. |
32 const char kRegistrationHostnameUrl[] = "register"; | 33 const char kRegistrationHostnameUrl[] = "register"; |
(...skipping 29 matching lines...) Expand all Loading... |
62 /////////////////////////////////////////////////////////////////////////////// | 63 /////////////////////////////////////////////////////////////////////////////// |
63 // RegistrationScreen, ViewScreen implementation: | 64 // RegistrationScreen, ViewScreen implementation: |
64 void RegistrationScreen::CreateView() { | 65 void RegistrationScreen::CreateView() { |
65 ViewScreen<RegistrationView>::CreateView(); | 66 ViewScreen<RegistrationView>::CreateView(); |
66 } | 67 } |
67 | 68 |
68 void RegistrationScreen::Refresh() { | 69 void RegistrationScreen::Refresh() { |
69 StartTimeoutTimer(); | 70 StartTimeoutTimer(); |
70 GURL url(kRegistrationHostPageUrl); | 71 GURL url(kRegistrationHostPageUrl); |
71 Profile* profile = ProfileManager::GetDefaultProfile(); | 72 Profile* profile = ProfileManager::GetDefaultProfile(); |
72 view()->InitDOM(profile, | 73 view()->InitDOM(profile, SiteInstance::CreateForURL(profile, url)); |
73 SiteInstance::CreateSiteInstanceForURL(profile, url)); | |
74 view()->SetWebContentsDelegate(this); | 74 view()->SetWebContentsDelegate(this); |
75 view()->LoadURL(url); | 75 view()->LoadURL(url); |
76 } | 76 } |
77 | 77 |
78 RegistrationView* RegistrationScreen::AllocateView() { | 78 RegistrationView* RegistrationScreen::AllocateView() { |
79 return new RegistrationView(); | 79 return new RegistrationView(); |
80 } | 80 } |
81 | 81 |
82 /////////////////////////////////////////////////////////////////////////////// | 82 /////////////////////////////////////////////////////////////////////////////// |
83 // RegistrationScreen, content::WebContentsDelegate implementation: | 83 // RegistrationScreen, content::WebContentsDelegate implementation: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 // static | 125 // static |
126 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, | 126 net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, |
127 const std::string& scheme) { | 127 const std::string& scheme) { |
128 VLOG(1) << "Handling url: " << request->url().spec().c_str(); | 128 VLOG(1) << "Handling url: " << request->url().spec().c_str(); |
129 return new net::URLRequestAboutJob(request); | 129 return new net::URLRequestAboutJob(request); |
130 } | 130 } |
131 | 131 |
132 } // namespace chromeos | 132 } // namespace chromeos |
OLD | NEW |