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

Unified Diff: chrome/browser/tab_contents/geoloc_infobar_delegate.h

Issue 160084: Chaos geolocation demo, non-WebKit part. Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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/tab_contents/geoloc_infobar_delegate.h
===================================================================
--- chrome/browser/tab_contents/geoloc_infobar_delegate.h (revision 0)
+++ chrome/browser/tab_contents/geoloc_infobar_delegate.h (revision 0)
@@ -0,0 +1,81 @@
+// Copyright (c) 2009 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_TAB_CONTENTS_GEOLOC_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_TAB_CONTENTS_GEOLOC_INFOBAR_DELEGATE_H_
+
+#include "app/resource_bundle.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/gtk/infobar_gtk.h"
+#include "chrome/browser/tab_contents/infobar_delegate.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "grit/theme_resources.h"
+
+class TabContents;
+
+class GeolocInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ explicit GeolocInfoBarDelegate(TabContents* contents);
+
+ // Overridden from ConfirmInfoBarDelegate:
+ virtual void InfoBarClosed();
+
+ virtual std::wstring GetMessageText() const {
+ return std::wstring(L"<b>Do you want to do the thing "
+ "you just told me to do?</b>");
+ }
+ virtual std::wstring GetCustomizeText() const {
+ return std::wstring(L"<span color=\"white\">Customize</span>");
+ }
+ virtual std::wstring GetLearnMoreText() const {
+ return std::wstring(L"<span color=\"white\">Learn more</span>");
+ }
+ virtual SkBitmap* GetIcon() const {
+ return ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_INFOBAR_RESTORE_SESSION);
+ }
+ virtual int GetButtons() const {
+ return BUTTON_OK | BUTTON_CANCEL | BUTTON_OK_DEFAULT;
+ }
+ virtual std::wstring GetButtonLabel(InfoBarButton button) const {
+ return button == BUTTON_OK ?
+ std::wstring(L"Obviously") :
+ std::wstring(L"Shockingly, no");
+ }
+
+ // Overridden from InfoBarDelegate:
+ // Returns the desired styling attributes for this infobar.
+ virtual InfoBarStyle* GetStyle() const { return style_.get(); }
+
+ // Called when the Learn More link is clicked. The |disposition|
+ // specifies how the resulting document should be loaded (based
+ // on the event flags present when the link was clicked). This
+ // function returns true if the InfoBar should be closed now or
+ // false if it should remain until the user explicitly closes it.
+ virtual bool LearnMoreClicked(WindowOpenDisposition disposition) {
+ return true;
+ }
+ virtual bool CustomizeClicked(WindowOpenDisposition disposition) {
+ customize_clicked_ = true;
+ return true;
+ }
+
+ // Overridden from ConfirmInfoBarDelegate:
+ virtual InfoBar* CreateInfoBar();
+ virtual GeolocInfoBarDelegate* AsGeolocInfoBarDelegate() {
+ return this;
+ }
+ private:
+ scoped_ptr<InfoBarStyle> style_;
+
+ TabContents *parent_contents_;
+
+ bool customize_clicked_;
+ bool learn_more_clicked_;
+
+ DISALLOW_COPY_AND_ASSIGN(GeolocInfoBarDelegate);
+};
+
+#endif // CHROME_BROWSER_GEOLOC_GEOLOC_INFOBAR_DELEGATE_H_
Property changes on: chrome/browser/tab_contents/geoloc_infobar_delegate.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698