Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / set_time_dialog.cc
blob62ceebba9b5873b7c7fc029741710c7adf243f61
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 "ui/gfx/geometry/size.h"
13 using content::WebContents;
14 using content::WebUIMessageHandler;
16 namespace chromeos {
18 namespace {
20 const int kDefaultWidth = 490;
21 const int kDefaultHeight = 235;
23 } // namespace
25 // static
26 void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) {
27 content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
28 chrome::ShowWebDialog(owning_window,
29 ProfileManager::GetActiveUserProfile(),
30 new SetTimeDialog());
33 SetTimeDialog::SetTimeDialog() {
36 SetTimeDialog::~SetTimeDialog() {
39 ui::ModalType SetTimeDialog::GetDialogModalType() const {
40 return ui::MODAL_TYPE_SYSTEM;
43 base::string16 SetTimeDialog::GetDialogTitle() const {
44 return base::string16();
47 GURL SetTimeDialog::GetDialogContentURL() const {
48 return GURL(chrome::kChromeUISetTimeURL);
51 void SetTimeDialog::GetWebUIMessageHandlers(
52 std::vector<WebUIMessageHandler*>* handlers) const {
55 void SetTimeDialog::GetDialogSize(gfx::Size* size) const {
56 size->SetSize(kDefaultWidth, kDefaultHeight);
59 std::string SetTimeDialog::GetDialogArgs() const {
60 return std::string();
63 void SetTimeDialog::OnDialogClosed(const std::string& json_retval) {
64 delete this;
67 void SetTimeDialog::OnCloseContents(WebContents* source,
68 bool* out_close_dialog) {
69 *out_close_dialog = true;
72 bool SetTimeDialog::ShouldShowDialogTitle() const {
73 return false;
76 bool SetTimeDialog::HandleContextMenu(
77 const content::ContextMenuParams& params) {
78 // Disable context menu.
79 return true;
82 } // namespace chromeos