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