Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4358)

Unified Diff: chrome/browser/chromeos/set_time_dialog.cc

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, single quotes in browsertest js Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/set_time_dialog.h ('k') | chrome/browser/resources/chromeos/set_time.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/set_time_dialog.cc
diff --git a/chrome/browser/chromeos/set_time_dialog.cc b/chrome/browser/chromeos/set_time_dialog.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fb68b8d864277b8862c4a436a97d14ab6be1ed4b
--- /dev/null
+++ b/chrome/browser/chromeos/set_time_dialog.cc
@@ -0,0 +1,85 @@
+// Copyright 2014 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/set_time_dialog.h"
+
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/user_metrics.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/size.h"
+
+using content::WebContents;
+using content::WebUIMessageHandler;
+
+namespace chromeos {
+
+namespace {
+
+const int kDefaultWidth = 490;
+const int kDefaultHeight = 235;
+
+} // namespace
+
+// static
+void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) {
+ content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show"));
+ chrome::ShowWebDialog(owning_window,
+ ProfileManager::GetActiveUserProfile(),
+ new SetTimeDialog());
+}
+
+SetTimeDialog::SetTimeDialog() {
+}
+
+SetTimeDialog::~SetTimeDialog() {
+}
+
+ui::ModalType SetTimeDialog::GetDialogModalType() const {
+ return ui::MODAL_TYPE_SYSTEM;
+}
+
+base::string16 SetTimeDialog::GetDialogTitle() const {
+ return base::string16();
+}
+
+GURL SetTimeDialog::GetDialogContentURL() const {
+ return GURL(chrome::kChromeUISetTimeURL);
+}
+
+void SetTimeDialog::GetWebUIMessageHandlers(
+ std::vector<WebUIMessageHandler*>* handlers) const {
+}
+
+void SetTimeDialog::GetDialogSize(gfx::Size* size) const {
+ size->SetSize(kDefaultWidth, kDefaultHeight);
+}
+
+std::string SetTimeDialog::GetDialogArgs() const {
+ return std::string();
+}
+
+void SetTimeDialog::OnDialogClosed(const std::string& json_retval) {
+ delete this;
+}
+
+void SetTimeDialog::OnCloseContents(WebContents* source,
+ bool* out_close_dialog) {
+ if (out_close_dialog)
+ *out_close_dialog = true;
+}
+
+bool SetTimeDialog::ShouldShowDialogTitle() const {
+ return false;
+}
+
+bool SetTimeDialog::HandleContextMenu(
+ const content::ContextMenuParams& params) {
+ // Disable context menu.
+ return true;
+}
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/set_time_dialog.h ('k') | chrome/browser/resources/chromeos/set_time.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698