EME test page application.
[chromium-blink-merge.git] / chrome / browser / chromeos / set_time_dialog.cc
blobfb68b8d864277b8862c4a436a97d14ab6be1ed4b
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;
18 namespace chromeos {
20 namespace {
22 const int kDefaultWidth = 490;
23 const int kDefaultHeight = 235;
25 } // namespace
27 // static
28 void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) {
29 content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
30 chrome::ShowWebDialog(owning_window,
31 ProfileManager::GetActiveUserProfile(),
32 new SetTimeDialog());
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 {
62 return std::string();
65 void SetTimeDialog::OnDialogClosed(const std::string& json_retval) {
66 delete this;
69 void SetTimeDialog::OnCloseContents(WebContents* source,
70 bool* out_close_dialog) {
71 if (out_close_dialog)
72 *out_close_dialog = true;
75 bool SetTimeDialog::ShouldShowDialogTitle() const {
76 return false;
79 bool SetTimeDialog::HandleContextMenu(
80 const content::ContextMenuParams& params) {
81 // Disable context menu.
82 return true;
85 } // namespace chromeos