blob: 5229c01570fba8bb58b630879cf73d582df3f062 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/choose_mobile_network_dialog.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/url_constants.h"
#include "ui/gfx/size.h"
using content::WebContents;
using content::WebUIMessageHandler;
namespace {
// Default width/height of the dialog.
const int kDefaultWidth = 350;
const int kDefaultHeight = 225;
} // namespace
namespace chromeos {
// static
void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window) {
chrome::ShowWebDialog(owning_window,
ProfileManager::GetActiveUserProfile(),
new ChooseMobileNetworkDialog);
}
ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() {
}
ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const {
return ui::MODAL_TYPE_SYSTEM;
}
base::string16 ChooseMobileNetworkDialog::GetDialogTitle() const {
return base::string16();
}
GURL ChooseMobileNetworkDialog::GetDialogContentURL() const {
return GURL(chrome::kChromeUIChooseMobileNetworkURL);
}
void ChooseMobileNetworkDialog::GetWebUIMessageHandlers(
std::vector<WebUIMessageHandler*>* handlers) const {
}
void ChooseMobileNetworkDialog::GetDialogSize(gfx::Size* size) const {
size->SetSize(kDefaultWidth, kDefaultHeight);
}
std::string ChooseMobileNetworkDialog::GetDialogArgs() const {
return "[]";
}
void ChooseMobileNetworkDialog::OnDialogClosed(const std::string& json_retval) {
delete this;
}
void ChooseMobileNetworkDialog::OnCloseContents(WebContents* source,
bool* out_close_dialog) {
if (out_close_dialog)
*out_close_dialog = true;
}
bool ChooseMobileNetworkDialog::ShouldShowDialogTitle() const {
return false;
}
bool ChooseMobileNetworkDialog::HandleContextMenu(
const content::ContextMenuParams& params) {
// Disable context menu.
return true;
}
} // namespace chromeos
|