| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/guid.h" | 11 #include "base/guid.h" |
| 12 #include "base/i18n/string_compare.h" | 12 #include "base/i18n/string_compare.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 17 #include "build/build_config.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/media/router/create_presentation_connection_request.h" | 19 #include "chrome/browser/media/router/create_presentation_connection_request.h" |
| 19 #include "chrome/browser/media/router/issue.h" | 20 #include "chrome/browser/media/router/issue.h" |
| 20 #include "chrome/browser/media/router/issues_observer.h" | 21 #include "chrome/browser/media/router/issues_observer.h" |
| 21 #include "chrome/browser/media/router/media_route.h" | 22 #include "chrome/browser/media/router/media_route.h" |
| 22 #include "chrome/browser/media/router/media_router.h" | 23 #include "chrome/browser/media/router/media_router.h" |
| 23 #include "chrome/browser/media/router/media_router_factory.h" | 24 #include "chrome/browser/media/router/media_router_factory.h" |
| 24 #include "chrome/browser/media/router/media_router_metrics.h" | 25 #include "chrome/browser/media/router/media_router_metrics.h" |
| 25 #include "chrome/browser/media/router/media_router_mojo_impl.h" | 26 #include "chrome/browser/media/router/media_router_mojo_impl.h" |
| 26 #include "chrome/browser/media/router/media_routes_observer.h" | 27 #include "chrome/browser/media/router/media_routes_observer.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 OnDefaultPresentationChanged(create_session_request_->presentation_request()); | 244 OnDefaultPresentationChanged(create_session_request_->presentation_request()); |
| 244 } | 245 } |
| 245 | 246 |
| 246 void MediaRouterUI::InitCommon(content::WebContents* initiator) { | 247 void MediaRouterUI::InitCommon(content::WebContents* initiator) { |
| 247 DCHECK(initiator); | 248 DCHECK(initiator); |
| 248 DCHECK(router_); | 249 DCHECK(router_); |
| 249 | 250 |
| 250 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator, | 251 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator, |
| 251 "MediaRouterUI::InitCommon", this); | 252 "MediaRouterUI::InitCommon", this); |
| 252 | 253 |
| 254 #if defined(OS_WIN) |
| 255 router_->OnUserGesture(); |
| 256 #endif |
| 253 // Create |collator_| before |query_result_manager_| so that |collator_| is | 257 // Create |collator_| before |query_result_manager_| so that |collator_| is |
| 254 // already set up when we get a callback from |query_result_manager_|. | 258 // already set up when we get a callback from |query_result_manager_|. |
| 255 UErrorCode error = U_ZERO_ERROR; | 259 UErrorCode error = U_ZERO_ERROR; |
| 256 const std::string& locale = g_browser_process->GetApplicationLocale(); | 260 const std::string& locale = g_browser_process->GetApplicationLocale(); |
| 257 collator_.reset( | 261 collator_.reset( |
| 258 icu::Collator::createInstance(icu::Locale(locale.c_str()), error)); | 262 icu::Collator::createInstance(icu::Locale(locale.c_str()), error)); |
| 259 if (U_FAILURE(error)) { | 263 if (U_FAILURE(error)) { |
| 260 DLOG(ERROR) << "Failed to create collator for locale " << locale; | 264 DLOG(ERROR) << "Failed to create collator for locale " << locale; |
| 261 collator_.reset(); | 265 collator_.reset(); |
| 262 } | 266 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 base::Time::Now() - start_time_); | 563 base::Time::Now() - start_time_); |
| 560 start_time_ = base::Time(); | 564 start_time_ = base::Time(); |
| 561 } | 565 } |
| 562 } | 566 } |
| 563 | 567 |
| 564 void MediaRouterUI::UpdateMaxDialogHeight(int height) { | 568 void MediaRouterUI::UpdateMaxDialogHeight(int height) { |
| 565 handler_->UpdateMaxDialogHeight(height); | 569 handler_->UpdateMaxDialogHeight(height); |
| 566 } | 570 } |
| 567 | 571 |
| 568 } // namespace media_router | 572 } // namespace media_router |
| OLD | NEW |