| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 TabContents assumes | 145 // We create the WebContents ourselves because the TabContents assumes |
| 146 // ownership of it. This should be reworked once we don't need to use the | 146 // ownership of it. This should be reworked once we don't need to use the |
| 147 // TabContents here. | 147 // TabContents here. |
| 148 WebContents* web_contents = | 148 WebContents* web_contents = |
| 149 WebContents::Create(ProfileManager::GetDefaultProfile(), | 149 WebContents::Create(ProfileManager::GetDefaultProfile(), |
| 150 NULL, | 150 NULL, |
| 151 MSG_ROUTING_NONE, | 151 MSG_ROUTING_NONE, |
| 152 NULL, | |
| 153 NULL); | 152 NULL); |
| 154 tab_contents_.reset(new TabContents(web_contents)); | 153 tab_contents_.reset(new TabContents(web_contents)); |
| 155 web_view_->SetWebContents(web_contents); | 154 web_view_->SetWebContents(web_contents); |
| 156 web_contents->SetDelegate(this); | 155 web_contents->SetDelegate(this); |
| 157 web_view_->LoadInitialURL(url); | 156 web_view_->LoadInitialURL(url); |
| 158 } | 157 } |
| 159 | 158 |
| 160 void SimpleWebViewDialog::Init() { | 159 void SimpleWebViewDialog::Init() { |
| 161 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); | 160 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); |
| 162 | 161 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 397 |
| 399 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 398 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 400 if (reload_) { | 399 if (reload_) { |
| 401 reload_->ChangeMode( | 400 reload_->ChangeMode( |
| 402 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 401 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 403 force); | 402 force); |
| 404 } | 403 } |
| 405 } | 404 } |
| 406 | 405 |
| 407 } // namespace chromeos | 406 } // namespace chromeos |
| OLD | NEW |