1 // Copyright (c) 2012 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/choose_mobile_network_dialog.h"
7 #include "chrome/browser/chromeos/login/user_manager.h"
8 #include "chrome/browser/profiles/profile_manager.h"
9 #include "chrome/browser/ui/browser_dialogs.h"
10 #include "chrome/common/url_constants.h"
11 #include "ui/gfx/size.h"
13 using content::WebContents
;
14 using content::WebUIMessageHandler
;
18 // Default width/height of the dialog.
19 const int kDefaultWidth
= 350;
20 const int kDefaultHeight
= 225;
27 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window
) {
28 chrome::ShowWebDialog(owning_window
,
29 ProfileManager::GetDefaultProfileOrOffTheRecord(),
30 new ChooseMobileNetworkDialog
);
33 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() {
36 ui::ModalType
ChooseMobileNetworkDialog::GetDialogModalType() const {
37 return ui::MODAL_TYPE_SYSTEM
;
40 string16
ChooseMobileNetworkDialog::GetDialogTitle() const {
44 GURL
ChooseMobileNetworkDialog::GetDialogContentURL() const {
45 return GURL(chrome::kChromeUIChooseMobileNetworkURL
);
48 void ChooseMobileNetworkDialog::GetWebUIMessageHandlers(
49 std::vector
<WebUIMessageHandler
*>* handlers
) const {
52 void ChooseMobileNetworkDialog::GetDialogSize(gfx::Size
* size
) const {
53 size
->SetSize(kDefaultWidth
, kDefaultHeight
);
56 std::string
ChooseMobileNetworkDialog::GetDialogArgs() const {
60 void ChooseMobileNetworkDialog::OnDialogClosed(const std::string
& json_retval
) {
64 void ChooseMobileNetworkDialog::OnCloseContents(WebContents
* source
,
65 bool* out_close_dialog
) {
67 *out_close_dialog
= true;
70 bool ChooseMobileNetworkDialog::ShouldShowDialogTitle() const {
74 bool ChooseMobileNetworkDialog::HandleContextMenu(
75 const content::ContextMenuParams
& params
) {
76 // Disable context menu.
80 } // namespace chromeos