1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h"
7 #include "chrome/browser/profiles/profile_manager.h"
8 #include "chrome/browser/ui/browser_dialogs.h"
9 #include "chrome/common/url_constants.h"
10 #include "ui/gfx/geometry/size.h"
12 using content::WebContents
;
13 using content::WebUIMessageHandler
;
17 // Default width/height of the dialog.
18 const int kDefaultWidth
= 350;
19 const int kDefaultHeight
= 225;
26 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window
) {
27 chrome::ShowWebDialog(owning_window
,
28 ProfileManager::GetActiveUserProfile(),
29 new ChooseMobileNetworkDialog
);
32 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() {
35 ui::ModalType
ChooseMobileNetworkDialog::GetDialogModalType() const {
36 return ui::MODAL_TYPE_SYSTEM
;
39 base::string16
ChooseMobileNetworkDialog::GetDialogTitle() const {
40 return base::string16();
43 GURL
ChooseMobileNetworkDialog::GetDialogContentURL() const {
44 return GURL(chrome::kChromeUIChooseMobileNetworkURL
);
47 void ChooseMobileNetworkDialog::GetWebUIMessageHandlers(
48 std::vector
<WebUIMessageHandler
*>* handlers
) const {
51 void ChooseMobileNetworkDialog::GetDialogSize(gfx::Size
* size
) const {
52 size
->SetSize(kDefaultWidth
, kDefaultHeight
);
55 std::string
ChooseMobileNetworkDialog::GetDialogArgs() const {
59 void ChooseMobileNetworkDialog::OnDialogClosed(const std::string
& json_retval
) {
63 void ChooseMobileNetworkDialog::OnCloseContents(WebContents
* source
,
64 bool* out_close_dialog
) {
65 *out_close_dialog
= true;
68 bool ChooseMobileNetworkDialog::ShouldShowDialogTitle() const {
72 bool ChooseMobileNetworkDialog::HandleContextMenu(
73 const content::ContextMenuParams
& params
) {
74 // Disable context menu.
78 } // namespace chromeos