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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc

Issue 2481413007: [MR UI] Set dialog width in MediaRouterDialogDelegate::GetDialogSize() if not set (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_dialog_controller_im pl.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im pl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return GURL(chrome::kChromeUIMediaRouterURL); 72 return GURL(chrome::kChromeUIMediaRouterURL);
73 } 73 }
74 74
75 void GetWebUIMessageHandlers( 75 void GetWebUIMessageHandlers(
76 std::vector<WebUIMessageHandler*>* handlers) const override { 76 std::vector<WebUIMessageHandler*>* handlers) const override {
77 // MediaRouterUI adds its own message handlers. 77 // MediaRouterUI adds its own message handlers.
78 } 78 }
79 79
80 void GetDialogSize(gfx::Size* size) const override { 80 void GetDialogSize(gfx::Size* size) const override {
81 DCHECK(size); 81 DCHECK(size);
82 // We set the dialog width if it's not set, so that the dialog is
83 // center-aligned horizontally when it appears.
84 if (size->width() != kWidth)
85 size->set_width(kWidth);
82 // GetDialogSize() is called when the browser window resizes. We may want to 86 // GetDialogSize() is called when the browser window resizes. We may want to
83 // update the maximum height of the dialog and scale the WebUI to the new 87 // update the maximum height of the dialog and scale the WebUI to the new
84 // height. |size| is not set because the dialog is auto-resizeable. 88 // height. |size| is not set because the dialog is auto-resizeable.
85 controller_->UpdateMaxDialogSize(); 89 controller_->UpdateMaxDialogSize();
86 } 90 }
87 91
88 std::string GetDialogArgs() const override { 92 std::string GetDialogArgs() const override {
89 return std::string(); 93 return std::string();
90 } 94 }
91 95
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 PresentationServiceDelegateImpl::FromWebContents(initiator()); 317 PresentationServiceDelegateImpl::FromWebContents(initiator());
314 if (!create_connection_request.get()) { 318 if (!create_connection_request.get()) {
315 media_router_ui->InitWithDefaultMediaSource(initiator(), delegate); 319 media_router_ui->InitWithDefaultMediaSource(initiator(), delegate);
316 } else { 320 } else {
317 media_router_ui->InitWithPresentationSessionRequest( 321 media_router_ui->InitWithPresentationSessionRequest(
318 initiator(), delegate, std::move(create_connection_request)); 322 initiator(), delegate, std::move(create_connection_request));
319 } 323 }
320 } 324 }
321 325
322 } // namespace media_router 326 } // namespace media_router
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698