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

Unified Diff: chrome/browser/chromeos/locale_change_guard.h

Issue 5976005: show notification on locale change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef Created 9 years, 11 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
Index: chrome/browser/chromeos/locale_change_guard.h
diff --git a/chrome/browser/chromeos/locale_change_guard.h b/chrome/browser/chromeos/locale_change_guard.h
new file mode 100644
index 0000000000000000000000000000000000000000..208848bca20dda9862aee1fc51c4a0ce91d1e7ea
--- /dev/null
+++ b/chrome/browser/chromeos/locale_change_guard.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_
+#define CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_
+#pragma once
+
+#include "base/lazy_instance.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/chromeos/notifications/system_notification.h"
+#include "chrome/browser/notifications/notification_delegate.h"
+#include "chrome/browser/profiles/profile.h"
+
+class ListValue;
+class TabContents;
+
+namespace chromeos {
+
+class LocaleChangeGuard {
oshima 2011/01/12 21:11:53 description of the class would be nice.
Denis Lagno 2011/01/13 10:46:44 Done.
+ public:
+ static void Check(TabContents* tab_contents);
+
+ private:
+ class Delegate : public NotificationDelegate {
+ public:
+ explicit Delegate(chromeos::LocaleChangeGuard* master) : master_(master) {}
+ void Close(bool by_user);
+ void Display() {}
+ void Error() {}
+ void Click() {}
+ std::string id() const;
+
+ private:
+ chromeos::LocaleChangeGuard* master_;
+
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
+ LocaleChangeGuard();
+ void CheckLocaleChange(TabContents* tab_contents);
+ void RevertLocaleChange(const ListValue* list);
+ void AcceptLocaleChange();
+
+ std::string from_locale_;
+ std::string to_locale_;
+ ProfileId profile_id_;
+ TabContents* tab_contents_;
+ scoped_ptr<chromeos::SystemNotification> note_;
+ bool reverted_;
+
+ friend struct base::DefaultLazyInstanceTraits<LocaleChangeGuard>;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOCALE_CHANGE_GUARD_H_
« no previous file with comments | « chrome/browser/chromeos/dom_ui/language_options_handler.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698