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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 web_view_container_.reset(new views::WebView(profile_)); | 143 web_view_container_.reset(new views::WebView(profile_)); |
144 web_view_ = web_view_container_.get(); | 144 web_view_ = web_view_container_.get(); |
145 | 145 |
146 // We create the WebContents ourselves because the TabContents assumes | 146 // We create the WebContents ourselves because the TabContents assumes |
147 // ownership of it. This should be reworked once we don't need to use the | 147 // ownership of it. This should be reworked once we don't need to use the |
148 // TabContents here. | 148 // TabContents here. |
149 WebContents* web_contents = | 149 WebContents* web_contents = |
150 WebContents::Create(ProfileManager::GetDefaultProfile(), | 150 WebContents::Create(ProfileManager::GetDefaultProfile(), |
151 NULL, | 151 NULL, |
152 MSG_ROUTING_NONE, | 152 MSG_ROUTING_NONE, |
153 NULL, | |
154 NULL); | 153 NULL); |
155 tab_contents_.reset(new TabContents(web_contents)); | 154 tab_contents_.reset(new TabContents(web_contents)); |
156 web_view_->SetWebContents(web_contents); | 155 web_view_->SetWebContents(web_contents); |
157 web_contents->SetDelegate(this); | 156 web_contents->SetDelegate(this); |
158 web_view_->LoadInitialURL(url); | 157 web_view_->LoadInitialURL(url); |
159 } | 158 } |
160 | 159 |
161 void SimpleWebViewDialog::Init() { | 160 void SimpleWebViewDialog::Init() { |
162 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); | 161 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); |
163 | 162 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 387 |
389 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 388 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
390 if (reload_) { | 389 if (reload_) { |
391 reload_->ChangeMode( | 390 reload_->ChangeMode( |
392 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 391 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
393 force); | 392 force); |
394 } | 393 } |
395 } | 394 } |
396 | 395 |
397 } // namespace chromeos | 396 } // namespace chromeos |
OLD | NEW |