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/set_time_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 "content/public/browser/user_metrics.h"
11 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/gfx/size.h"
15 using content::WebContents
;
16 using content::WebUIMessageHandler
;
22 const int kDefaultWidth
= 490;
23 const int kDefaultHeight
= 235;
28 void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window
) {
29 content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
30 chrome::ShowWebDialog(owning_window
,
31 ProfileManager::GetActiveUserProfile(),
35 SetTimeDialog::SetTimeDialog() {
38 SetTimeDialog::~SetTimeDialog() {
41 ui::ModalType
SetTimeDialog::GetDialogModalType() const {
42 return ui::MODAL_TYPE_SYSTEM
;
45 base::string16
SetTimeDialog::GetDialogTitle() const {
46 return base::string16();
49 GURL
SetTimeDialog::GetDialogContentURL() const {
50 return GURL(chrome::kChromeUISetTimeURL
);
53 void SetTimeDialog::GetWebUIMessageHandlers(
54 std::vector
<WebUIMessageHandler
*>* handlers
) const {
57 void SetTimeDialog::GetDialogSize(gfx::Size
* size
) const {
58 size
->SetSize(kDefaultWidth
, kDefaultHeight
);
61 std::string
SetTimeDialog::GetDialogArgs() const {
65 void SetTimeDialog::OnDialogClosed(const std::string
& json_retval
) {
69 void SetTimeDialog::OnCloseContents(WebContents
* source
,
70 bool* out_close_dialog
) {
72 *out_close_dialog
= true;
75 bool SetTimeDialog::ShouldShowDialogTitle() const {
79 bool SetTimeDialog::HandleContextMenu(
80 const content::ContextMenuParams
& params
) {
81 // Disable context menu.
85 } // namespace chromeos