ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / chromeos / ui / choose_mobile_network_dialog.cc
blob0da2c86936efd7041d7299b9229ebd4579b47eba
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;
15 namespace {
17 // Default width/height of the dialog.
18 const int kDefaultWidth = 350;
19 const int kDefaultHeight = 225;
21 } // namespace
23 namespace chromeos {
25 // static
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 {
56 return "[]";
59 void ChooseMobileNetworkDialog::OnDialogClosed(const std::string& json_retval) {
60 delete this;
63 void ChooseMobileNetworkDialog::OnCloseContents(WebContents* source,
64 bool* out_close_dialog) {
65 *out_close_dialog = true;
68 bool ChooseMobileNetworkDialog::ShouldShowDialogTitle() const {
69 return false;
72 bool ChooseMobileNetworkDialog::HandleContextMenu(
73 const content::ContextMenuParams& params) {
74 // Disable context menu.
75 return true;
78 } // namespace chromeos