| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 command_updater_->UpdateCommandEnabled(IDC_STOP, true); | 130 command_updater_->UpdateCommandEnabled(IDC_STOP, true); |
| 131 command_updater_->UpdateCommandEnabled(IDC_RELOAD, true); | 131 command_updater_->UpdateCommandEnabled(IDC_RELOAD, true); |
| 132 command_updater_->UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); | 132 command_updater_->UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); |
| 133 command_updater_->UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); | 133 command_updater_->UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); |
| 134 } | 134 } |
| 135 | 135 |
| 136 SimpleWebViewDialog::~SimpleWebViewDialog() { | 136 SimpleWebViewDialog::~SimpleWebViewDialog() { |
| 137 if (web_view_container_.get()) { | 137 if (web_view_container_.get()) { |
| 138 // WebView can't be deleted immediately, because it could be on the stack. | 138 // WebView can't be deleted immediately, because it could be on the stack. |
| 139 web_view_->web_contents()->SetDelegate(NULL); | 139 web_view_->web_contents()->SetDelegate(NULL); |
| 140 MessageLoop::current()->DeleteSoon( | 140 base::MessageLoop::current()->DeleteSoon(FROM_HERE, |
| 141 FROM_HERE, web_view_container_.release()); | 141 web_view_container_.release()); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 void SimpleWebViewDialog::StartLoad(const GURL& url) { | 145 void SimpleWebViewDialog::StartLoad(const GURL& url) { |
| 146 web_view_container_.reset(new views::WebView(profile_)); | 146 web_view_container_.reset(new views::WebView(profile_)); |
| 147 web_view_ = web_view_container_.get(); | 147 web_view_ = web_view_container_.get(); |
| 148 web_view_->GetWebContents()->SetDelegate(this); | 148 web_view_->GetWebContents()->SetDelegate(this); |
| 149 web_view_->LoadInitialURL(url); | 149 web_view_->LoadInitialURL(url); |
| 150 | 150 |
| 151 WebContents* web_contents = web_view_->GetWebContents(); | 151 WebContents* web_contents = web_view_->GetWebContents(); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 380 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 381 if (reload_) { | 381 if (reload_) { |
| 382 reload_->ChangeMode( | 382 reload_->ChangeMode( |
| 383 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 383 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 384 force); | 384 force); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace chromeos | 388 } // namespace chromeos |
| OLD | NEW |