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

Unified Diff: chrome/browser/tab_contents/customize_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/customize_geoloc_infobar_delegate.h
===================================================================
--- chrome/browser/tab_contents/customize_geoloc_infobar_delegate.h (revision 0)
+++ chrome/browser/tab_contents/customize_geoloc_infobar_delegate.h (revision 0)
@@ -0,0 +1,74 @@
+// 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_CUSTOMIZE_GEOLOC_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_TAB_CONTENTS_CUSTOMIZE_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 CustomizeGeolocInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ enum GeolocButton {
+ BUTTON_BEST = 0,
+ BUTTON_CITY = 1,
+ BUTTON_NONE = 2
+ };
+
+ explicit CustomizeGeolocInfoBarDelegate(TabContents* contents);
+
+ virtual ~CustomizeGeolocInfoBarDelegate();
+ // Overridden from ConfirmInfoBarDelegate:
+ virtual void InfoBarClosed() {
+ delete this;
+ }
+ virtual std::wstring GetMessageText() const {
+ return std::wstring(L"<b>google.com wishes to use your location</b>");
+ }
+ virtual std::wstring GetAuxiliaryText() const {
+ return std::wstring(L"Please choose how much information you want to release");
+ }
+
+ virtual SkBitmap* GetIcon() const {
+ return ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_INFOBAR_RESTORE_SESSION);
+ }
+ virtual SkBitmap* GetGeolocButtonImage(GeolocButton button) const;
+
+ virtual std::wstring GetGeolocButtonLabel(GeolocButton button) const;
+
+ // return true if the infobar should be closed.
+ virtual bool OnGeolocButtonClick(GeolocButton button) const;
+
+ virtual int GetButtons() const {
+ return BUTTON_NONE;
+ }
+ virtual std::wstring GetButtonLabel(InfoBarButton button) const {
+ return std::wstring(L"");
+ }
+
+ // Overridden from InfoBarDelegate:
+ // Returns the desired styling attributes for this infobar.
+ virtual InfoBarStyle* GetStyle() const { return style_.get(); }
+
+ // Overridden from ConfirmInfoBarDelegate:
+ virtual InfoBar* CreateInfoBar();
+ virtual CustomizeGeolocInfoBarDelegate* AsCustomizeGeolocInfoBarDelegate() {
+ return this;
+ }
+ private:
+ scoped_ptr<InfoBarStyle> style_;
+ TabContents *contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(CustomizeGeolocInfoBarDelegate);
+};
+
+#endif
Property changes on: chrome/browser/tab_contents/customize_geoloc_infobar_delegate.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698