| 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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 258 } |
| 259 | 259 |
| 260 void SimpleWebViewDialog::NavigationStateChanged( | 260 void SimpleWebViewDialog::NavigationStateChanged( |
| 261 const WebContents* source, unsigned changed_flags) { | 261 const WebContents* source, unsigned changed_flags) { |
| 262 if (location_bar_) { | 262 if (location_bar_) { |
| 263 location_bar_->Update(NULL); | 263 location_bar_->Update(NULL); |
| 264 UpdateButtons(); | 264 UpdateButtons(); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 void SimpleWebViewDialog::LoadingStateChanged(WebContents* source) { | 268 void SimpleWebViewDialog::LoadingStateChanged(WebContents* source, |
| 269 bool to_different_document) { |
| 269 bool is_loading = source->IsLoading(); | 270 bool is_loading = source->IsLoading(); |
| 270 UpdateReload(is_loading, false); | 271 UpdateReload(is_loading && to_different_document, false); |
| 271 command_updater_->UpdateCommandEnabled(IDC_STOP, is_loading); | 272 command_updater_->UpdateCommandEnabled(IDC_STOP, is_loading); |
| 272 } | 273 } |
| 273 | 274 |
| 274 WebContents* SimpleWebViewDialog::GetWebContents() { | 275 WebContents* SimpleWebViewDialog::GetWebContents() { |
| 275 return NULL; | 276 return NULL; |
| 276 } | 277 } |
| 277 | 278 |
| 278 ToolbarModel* SimpleWebViewDialog::GetToolbarModel() { | 279 ToolbarModel* SimpleWebViewDialog::GetToolbarModel() { |
| 279 return toolbar_model_.get(); | 280 return toolbar_model_.get(); |
| 280 } | 281 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 388 |
| 388 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 389 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 389 if (reload_) { | 390 if (reload_) { |
| 390 reload_->ChangeMode( | 391 reload_->ChangeMode( |
| 391 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 392 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 392 force); | 393 force); |
| 393 } | 394 } |
| 394 } | 395 } |
| 395 | 396 |
| 396 } // namespace chromeos | 397 } // namespace chromeos |
| OLD | NEW |