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

Unified Diff: chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc

Issue 10830050: (Views only) Prompt the user to reload the website after changing site permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments (Finnur). Created 8 years, 5 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/ui/website_settings/website_settings_infobar_delegate.cc
diff --git a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ff0acc83bfe31986da27f5e5b985aed384934318
--- /dev/null
+++ b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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/ui/website_settings/website_settings_infobar_delegate.h"
+
+#include "base/logging.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
+#include "content/public/browser/web_contents.h"
+#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+
+WebsiteSettingsInfobarDelegate::WebsiteSettingsInfobarDelegate(
+ InfoBarTabHelper* infobar_helper)
+ : ConfirmInfoBarDelegate(infobar_helper) {
+}
+
+gfx::Image* WebsiteSettingsInfobarDelegate::GetIcon() const {
+ return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
+ IDR_INFOBAR_ALT_NAV_URL);
+}
+
+InfoBarDelegate::Type WebsiteSettingsInfobarDelegate::GetInfoBarType() const {
+ return PAGE_ACTION_TYPE;
+}
+
+string16 WebsiteSettingsInfobarDelegate::GetMessageText() const {
+ return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_TEXT);
+}
+
+int WebsiteSettingsInfobarDelegate::GetButtons() const {
+ return BUTTON_OK;
+}
+
+string16 WebsiteSettingsInfobarDelegate::GetButtonLabel(
+ InfoBarButton button) const {
+ DCHECK_EQ(BUTTON_OK, button);
+ return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON);
+}
+
+bool WebsiteSettingsInfobarDelegate::Accept() {
+ owner()->web_contents()->GetController().Reload(true);
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698