Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: chrome/browser/chromeos/login/captive_portal_view.cc

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/captive_portal_view.cc
diff --git a/chrome/browser/chromeos/login/captive_portal_view.cc b/chrome/browser/chromeos/login/captive_portal_view.cc
deleted file mode 100644
index 89012321944265e415c5f52f15015b86cfb75056..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/captive_portal_view.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/login/captive_portal_view.h"
-
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chromeos/login/captive_portal_window_proxy.h"
-#include "chromeos/network/network_handler.h"
-#include "chromeos/network/network_state.h"
-#include "chromeos/network/network_state_handler.h"
-#include "components/captive_portal/captive_portal_detector.h"
-#include "content/public/browser/web_contents.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/views/window/dialog_delegate.h"
-#include "url/gurl.h"
-
-namespace {
-
-const char* CaptivePortalStartURL() {
- return captive_portal::CaptivePortalDetector::kDefaultURL;
-}
-
-} // namespace
-
-namespace chromeos {
-
-CaptivePortalView::CaptivePortalView(Profile* profile,
- CaptivePortalWindowProxy* proxy)
- : SimpleWebViewDialog(profile),
- proxy_(proxy),
- redirected_(false) {
-}
-
-CaptivePortalView::~CaptivePortalView() {
-}
-
-void CaptivePortalView::StartLoad() {
- SimpleWebViewDialog::StartLoad(GURL(CaptivePortalStartURL()));
-}
-
-bool CaptivePortalView::CanResize() const {
- return false;
-}
-
-ui::ModalType CaptivePortalView::GetModalType() const {
- return ui::MODAL_TYPE_SYSTEM;
-}
-
-base::string16 CaptivePortalView::GetWindowTitle() const {
- base::string16 network_name;
- const NetworkState* default_network =
- NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
- std::string default_network_name =
- default_network ? default_network->name() : std::string();
- if (!default_network_name.empty()) {
- network_name = base::ASCIIToUTF16(default_network_name);
- } else {
- DLOG(ERROR)
- << "No active/default network, but captive portal window is shown.";
- }
-
- return l10n_util::GetStringFUTF16(IDS_LOGIN_CAPTIVE_PORTAL_WINDOW_TITLE,
- network_name);
-}
-
-bool CaptivePortalView::ShouldShowWindowTitle() const {
- return true;
-}
-
-views::NonClientFrameView* CaptivePortalView::CreateNonClientFrameView(
- views::Widget* widget) {
- return views::DialogDelegate::CreateDialogFrameView(widget);
-}
-
-void CaptivePortalView::NavigationStateChanged(
- const content::WebContents* source, unsigned changed_flags) {
- SimpleWebViewDialog::NavigationStateChanged(source, changed_flags);
-
- // Naive way to determine the redirection. This won't be needed after portal
- // detection will be done on the Chrome side.
- GURL url = source->GetLastCommittedURL();
- // Note, |url| will be empty for "client3.google.com/generate_204" page.
- if (!redirected_ && url != GURL::EmptyGURL() &&
- url != GURL(CaptivePortalStartURL())) {
- redirected_ = true;
- proxy_->OnRedirected();
- }
-}
-
-void CaptivePortalView::LoadingStateChanged(content::WebContents* source,
- bool to_different_document) {
- SimpleWebViewDialog::LoadingStateChanged(source, to_different_document);
- // TODO(nkostylev): Fix case of no connectivity, check HTTP code returned.
- // Disable this heuristic as it has false positives.
- // Relying on just shill portal check to close dialog is fine.
- // if (!is_loading && !redirected_)
- // proxy_->OnOriginalURLLoaded();
-}
-
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698