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