| 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 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 OnDefaultPresentationChanged(create_session_request_->presentation_request()); | 244 OnDefaultPresentationChanged(create_session_request_->presentation_request()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void MediaRouterUI::InitCommon(content::WebContents* initiator) { | 247 void MediaRouterUI::InitCommon(content::WebContents* initiator) { |
| 248 DCHECK(initiator); | 248 DCHECK(initiator); |
| 249 DCHECK(router_); | 249 DCHECK(router_); |
| 250 | 250 |
| 251 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator, | 251 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator, |
| 252 "MediaRouterUI::InitCommon", this); | 252 "MediaRouterUI::InitCommon", this); |
| 253 | 253 |
| 254 #if defined(OS_WIN) | |
| 255 router_->OnUserGesture(); | 254 router_->OnUserGesture(); |
| 256 #endif | 255 |
| 257 // Create |collator_| before |query_result_manager_| so that |collator_| is | 256 // Create |collator_| before |query_result_manager_| so that |collator_| is |
| 258 // already set up when we get a callback from |query_result_manager_|. | 257 // already set up when we get a callback from |query_result_manager_|. |
| 259 UErrorCode error = U_ZERO_ERROR; | 258 UErrorCode error = U_ZERO_ERROR; |
| 260 const std::string& locale = g_browser_process->GetApplicationLocale(); | 259 const std::string& locale = g_browser_process->GetApplicationLocale(); |
| 261 collator_.reset( | 260 collator_.reset( |
| 262 icu::Collator::createInstance(icu::Locale(locale.c_str()), error)); | 261 icu::Collator::createInstance(icu::Locale(locale.c_str()), error)); |
| 263 if (U_FAILURE(error)) { | 262 if (U_FAILURE(error)) { |
| 264 DLOG(ERROR) << "Failed to create collator for locale " << locale; | 263 DLOG(ERROR) << "Failed to create collator for locale " << locale; |
| 265 collator_.reset(); | 264 collator_.reset(); |
| 266 } | 265 } |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 base::Time::Now() - start_time_); | 580 base::Time::Now() - start_time_); |
| 582 start_time_ = base::Time(); | 581 start_time_ = base::Time(); |
| 583 } | 582 } |
| 584 } | 583 } |
| 585 | 584 |
| 586 void MediaRouterUI::UpdateMaxDialogHeight(int height) { | 585 void MediaRouterUI::UpdateMaxDialogHeight(int height) { |
| 587 handler_->UpdateMaxDialogHeight(height); | 586 handler_->UpdateMaxDialogHeight(height); |
| 588 } | 587 } |
| 589 | 588 |
| 590 } // namespace media_router | 589 } // namespace media_router |
| OLD | NEW |