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/simple_web_view_dialog.h" | 5 #include "chrome/browser/chromeos/login/simple_web_view_dialog.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 web_view_->web_contents()->SetDelegate(NULL); | 135 web_view_->web_contents()->SetDelegate(NULL); |
136 MessageLoop::current()->DeleteSoon( | 136 MessageLoop::current()->DeleteSoon( |
137 FROM_HERE, web_view_container_.release()); | 137 FROM_HERE, web_view_container_.release()); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 void SimpleWebViewDialog::StartLoad(const GURL& url) { | 141 void SimpleWebViewDialog::StartLoad(const GURL& url) { |
142 web_view_container_.reset(new views::WebView(profile_)); | 142 web_view_container_.reset(new views::WebView(profile_)); |
143 web_view_ = web_view_container_.get(); | 143 web_view_ = web_view_container_.get(); |
144 | 144 |
145 // We create the WebContents ourselves because the TCW assumes ownership of | 145 // We create the WebContents ourselves because the TabContents assumes |
146 // it. This should be reworked once we don't need to use the TCW here. | 146 // ownership of it. This should be reworked once we don't need to use the |
| 147 // TabContents here. |
147 WebContents* web_contents = | 148 WebContents* web_contents = |
148 WebContents::Create(ProfileManager::GetDefaultProfile(), | 149 WebContents::Create(ProfileManager::GetDefaultProfile(), |
149 NULL, | 150 NULL, |
150 MSG_ROUTING_NONE, | 151 MSG_ROUTING_NONE, |
151 NULL, | 152 NULL, |
152 NULL); | 153 NULL); |
153 tab_contents_.reset(new TabContents(web_contents)); | 154 tab_contents_.reset(new TabContents(web_contents)); |
154 web_view_->SetWebContents(web_contents); | 155 web_view_->SetWebContents(web_contents); |
155 web_contents->SetDelegate(this); | 156 web_contents->SetDelegate(this); |
156 web_view_->LoadInitialURL(url); | 157 web_view_->LoadInitialURL(url); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 397 |
397 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 398 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
398 if (reload_) { | 399 if (reload_) { |
399 reload_->ChangeMode( | 400 reload_->ChangeMode( |
400 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 401 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
401 force); | 402 force); |
402 } | 403 } |
403 } | 404 } |
404 | 405 |
405 } // namespace chromeos | 406 } // namespace chromeos |
OLD | NEW |