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

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

Issue 7124001: [cleanup] Use Delegate method to control context menu and eliminate HtmlDialogWithoutContextMenuView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 6 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/sim_dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/sim_dialog_delegate.cc
diff --git a/chrome/browser/chromeos/sim_dialog_delegate.cc b/chrome/browser/chromeos/sim_dialog_delegate.cc
index f1ecabae274e8132c343817e416cd8681ad32286..b9ea14eb917476860cb45529a4576febf0747989 100644
--- a/chrome/browser/chromeos/sim_dialog_delegate.cc
+++ b/chrome/browser/chromeos/sim_dialog_delegate.cc
@@ -36,27 +36,13 @@ const char kSimDialogChangePinMode[] = "change-pin";
const char kSimDialogSetLockOnMode[] = "set-lock-on";
const char kSimDialogSetLockOffMode[] = "set-lock-off";
-// Custom HtmlDialogView with disabled context menu.
-class HtmlDialogWithoutContextMenuView : public HtmlDialogView {
- public:
- HtmlDialogWithoutContextMenuView(Profile* profile,
- HtmlDialogUIDelegate* delegate)
- : HtmlDialogView(profile, delegate) {}
-
- // TabContentsDelegate implementation.
- bool HandleContextMenu(const ContextMenuParams& params) {
- // Disable context menu.
- return true;
- }
-};
-
} // namespace
namespace chromeos {
// static
void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window,
- SimDialogMode mode) {
+ SimDialogMode mode) {
Profile* profile;
if (UserManager::Get()->user_is_logged_in()) {
Browser* browser = BrowserList::GetLastActive();
@@ -65,8 +51,8 @@ void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window,
} else {
profile = ProfileManager::GetDefaultProfile();
}
- HtmlDialogView* html_view = new HtmlDialogWithoutContextMenuView(
- profile, new SimDialogDelegate(mode));
+ HtmlDialogView* html_view =
+ new HtmlDialogView(profile, new SimDialogDelegate(mode));
html_view->InitDialog();
chromeos::BubbleWindow::Create(owning_window,
gfx::Rect(),
@@ -136,4 +122,9 @@ bool SimDialogDelegate::ShouldShowDialogTitle() const {
return false;
}
+bool SimDialogDelegate::HandleContextMenu(const ContextMenuParams& params) {
+ // Disable context menu.
+ return true;
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/sim_dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698