| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/simple_web_view_dialog.h" | 5 #include "chrome/browser/chromeos/login/ui/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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 forward_(NULL), | 130 forward_(NULL), |
| 131 reload_(NULL), | 131 reload_(NULL), |
| 132 location_bar_(NULL), | 132 location_bar_(NULL), |
| 133 web_view_(NULL), | 133 web_view_(NULL), |
| 134 bubble_model_delegate_(new StubBubbleModelDelegate) { | 134 bubble_model_delegate_(new StubBubbleModelDelegate) { |
| 135 command_updater_.reset(new CommandUpdater(this)); | 135 command_updater_.reset(new CommandUpdater(this)); |
| 136 command_updater_->UpdateCommandEnabled(IDC_BACK, true); | 136 command_updater_->UpdateCommandEnabled(IDC_BACK, true); |
| 137 command_updater_->UpdateCommandEnabled(IDC_FORWARD, true); | 137 command_updater_->UpdateCommandEnabled(IDC_FORWARD, true); |
| 138 command_updater_->UpdateCommandEnabled(IDC_STOP, true); | 138 command_updater_->UpdateCommandEnabled(IDC_STOP, true); |
| 139 command_updater_->UpdateCommandEnabled(IDC_RELOAD, true); | 139 command_updater_->UpdateCommandEnabled(IDC_RELOAD, true); |
| 140 command_updater_->UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); | 140 command_updater_->UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); |
| 141 command_updater_->UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); | 141 command_updater_->UpdateCommandEnabled(IDC_RELOAD_CLEARING_CACHE, true); |
| 142 } | 142 } |
| 143 | 143 |
| 144 SimpleWebViewDialog::~SimpleWebViewDialog() { | 144 SimpleWebViewDialog::~SimpleWebViewDialog() { |
| 145 if (web_view_ && web_view_->web_contents()) | 145 if (web_view_ && web_view_->web_contents()) |
| 146 web_view_->web_contents()->SetDelegate(NULL); | 146 web_view_->web_contents()->SetDelegate(NULL); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void SimpleWebViewDialog::StartLoad(const GURL& url) { | 149 void SimpleWebViewDialog::StartLoad(const GURL& url) { |
| 150 if (!web_view_container_.get()) | 150 if (!web_view_container_.get()) |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 case IDC_FORWARD: | 342 case IDC_FORWARD: |
| 343 if (web_contents->GetController().CanGoForward()) { | 343 if (web_contents->GetController().CanGoForward()) { |
| 344 location_bar_->Revert(); | 344 location_bar_->Revert(); |
| 345 web_contents->GetController().GoForward(); | 345 web_contents->GetController().GoForward(); |
| 346 } | 346 } |
| 347 break; | 347 break; |
| 348 case IDC_STOP: | 348 case IDC_STOP: |
| 349 web_contents->Stop(); | 349 web_contents->Stop(); |
| 350 break; | 350 break; |
| 351 case IDC_RELOAD: | 351 case IDC_RELOAD: |
| 352 // Always reload ignoring cache. | 352 // Always reload bypassing cache. |
| 353 case IDC_RELOAD_IGNORING_CACHE: | 353 case IDC_RELOAD_BYPASSING_CACHE: |
| 354 case IDC_RELOAD_CLEARING_CACHE: | 354 case IDC_RELOAD_CLEARING_CACHE: |
| 355 location_bar_->Revert(); | 355 location_bar_->Revert(); |
| 356 web_contents->GetController().ReloadIgnoringCache(true); | 356 web_contents->GetController().ReloadBypassingCache(true); |
| 357 break; | 357 break; |
| 358 default: | 358 default: |
| 359 NOTREACHED(); | 359 NOTREACHED(); |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 void SimpleWebViewDialog::LoadImages() { | 363 void SimpleWebViewDialog::LoadImages() { |
| 364 const ui::ThemeProvider* tp = GetThemeProvider(); | 364 const ui::ThemeProvider* tp = GetThemeProvider(); |
| 365 | 365 |
| 366 back_->SetImage(views::CustomButton::STATE_NORMAL, | 366 back_->SetImage(views::CustomButton::STATE_NORMAL, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 393 | 393 |
| 394 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 394 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 395 if (reload_) { | 395 if (reload_) { |
| 396 reload_->ChangeMode( | 396 reload_->ChangeMode( |
| 397 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 397 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 398 force); | 398 force); |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace chromeos | 402 } // namespace chromeos |
| OLD | NEW |