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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use
2 // of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CUSTOMIZE_GEOLOC_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_CUSTOMIZE_GEOLOC_INFOBAR_DELEGATE_H_
7
8 #include "app/resource_bundle.h"
9 #include "base/scoped_ptr.h"
10 #include "chrome/browser/gtk/infobar_gtk.h"
11 #include "chrome/browser/tab_contents/infobar_delegate.h"
12 #include "chrome/browser/tab_contents/tab_contents.h"
13 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "grit/theme_resources.h"
15
16 class TabContents;
17
18 class CustomizeGeolocInfoBarDelegate : public ConfirmInfoBarDelegate {
19 public:
20 enum GeolocButton {
21 BUTTON_BEST = 0,
22 BUTTON_CITY = 1,
23 BUTTON_NONE = 2
24 };
25
26 explicit CustomizeGeolocInfoBarDelegate(TabContents* contents);
27
28 virtual ~CustomizeGeolocInfoBarDelegate();
29 // Overridden from ConfirmInfoBarDelegate:
30 virtual void InfoBarClosed() {
31 delete this;
32 }
33 virtual std::wstring GetMessageText() const {
34 return std::wstring(L"<b>google.com wishes to use your location</b>");
35 }
36 virtual std::wstring GetAuxiliaryText() const {
37 return std::wstring(L"Please choose how much information you want to release ");
38 }
39
40 virtual SkBitmap* GetIcon() const {
41 return ResourceBundle::GetSharedInstance().GetBitmapNamed(
42 IDR_INFOBAR_RESTORE_SESSION);
43 }
44 virtual SkBitmap* GetGeolocButtonImage(GeolocButton button) const;
45
46 virtual std::wstring GetGeolocButtonLabel(GeolocButton button) const;
47
48 // return true if the infobar should be closed.
49 virtual bool OnGeolocButtonClick(GeolocButton button) const;
50
51 virtual int GetButtons() const {
52 return BUTTON_NONE;
53 }
54 virtual std::wstring GetButtonLabel(InfoBarButton button) const {
55 return std::wstring(L"");
56 }
57
58 // Overridden from InfoBarDelegate:
59 // Returns the desired styling attributes for this infobar.
60 virtual InfoBarStyle* GetStyle() const { return style_.get(); }
61
62 // Overridden from ConfirmInfoBarDelegate:
63 virtual InfoBar* CreateInfoBar();
64 virtual CustomizeGeolocInfoBarDelegate* AsCustomizeGeolocInfoBarDelegate() {
65 return this;
66 }
67 private:
68 scoped_ptr<InfoBarStyle> style_;
69 TabContents *contents_;
70
71 DISALLOW_COPY_AND_ASSIGN(CustomizeGeolocInfoBarDelegate);
72 };
73
74 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698