| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/webui/media_router/media_router_ui.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/media/router/create_session_request.h" | 10 #include "chrome/browser/media/router/create_session_request.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "ui/web_dialogs/web_dialog_delegate.h" | 32 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 33 | 33 |
| 34 namespace media_router { | 34 namespace media_router { |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 std::string GetHostFromURL(const GURL& gurl) { | 38 std::string GetHostFromURL(const GURL& gurl) { |
| 39 if (gurl.is_empty()) | 39 if (gurl.is_empty()) |
| 40 return std::string(); | 40 return std::string(); |
| 41 std::string host = gurl.host(); | 41 std::string host = gurl.host(); |
| 42 if (base::StartsWithASCII(host, "www.", false)) | 42 if (base::StartsWith(host, "www.", base::CompareCase::INSENSITIVE_ASCII)) |
| 43 host = host.substr(4); | 43 host = host.substr(4); |
| 44 return host; | 44 return host; |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // This class calls to refresh the UI when the highest priority issue is | 49 // This class calls to refresh the UI when the highest priority issue is |
| 50 // updated. | 50 // updated. |
| 51 class MediaRouterUI::UIIssuesObserver : public IssuesObserver { | 51 class MediaRouterUI::UIIssuesObserver : public IssuesObserver { |
| 52 public: | 52 public: |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 base::Bind(&MediaRouterUI::OnRouteResponseReceived, | 334 base::Bind(&MediaRouterUI::OnRouteResponseReceived, |
| 335 weak_factory_.GetWeakPtr())); | 335 weak_factory_.GetWeakPtr())); |
| 336 return true; | 336 return true; |
| 337 } | 337 } |
| 338 | 338 |
| 339 std::string MediaRouterUI::GetFrameURLHost() const { | 339 std::string MediaRouterUI::GetFrameURLHost() const { |
| 340 return GetHostFromURL(frame_url_); | 340 return GetHostFromURL(frame_url_); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace media_router | 343 } // namespace media_router |
| OLD | NEW |