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

Side by Side Diff: chrome/browser/geolocation/geolocation_infobar_delegate.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming back to GetIcon() Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h" 5 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
6 6
7 #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" 7 #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
8 #include "chrome/browser/google/google_util.h" 8 #include "chrome/browser/google/google_util.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "content/public/browser/navigation_details.h" 10 #include "content/public/browser/navigation_details.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return true; 58 return true;
59 } 59 }
60 60
61 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, 61 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
62 bool allowed) { 62 bool allowed) {
63 controller_->OnPermissionSet(id_, requesting_frame_, 63 controller_->OnPermissionSet(id_, requesting_frame_,
64 web_contents()->GetURL(), 64 web_contents()->GetURL(),
65 update_content_setting, allowed); 65 update_content_setting, allowed);
66 } 66 }
67 67
68 gfx::Image* GeolocationInfoBarDelegate::GetIcon() const { 68 int GeolocationInfoBarDelegate::GetIconID() const {
69 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 69 return IDR_GEOLOCATION_INFOBAR_ICON;
70 IDR_GEOLOCATION_INFOBAR_ICON);
71 } 70 }
72 71
73 InfoBarDelegate::Type GeolocationInfoBarDelegate::GetInfoBarType() const { 72 InfoBarDelegate::Type GeolocationInfoBarDelegate::GetInfoBarType() const {
74 return PAGE_ACTION_TYPE; 73 return PAGE_ACTION_TYPE;
75 } 74 }
76 75
77 bool GeolocationInfoBarDelegate::ShouldExpireInternal( 76 bool GeolocationInfoBarDelegate::ShouldExpireInternal(
78 const content::LoadCommittedDetails& details) const { 77 const content::LoadCommittedDetails& details) const {
79 // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but 78 // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but
80 // uses the unique ID we set in the constructor instead of that stored in the 79 // uses the unique ID we set in the constructor instead of that stored in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 #endif 114 #endif
116 115
117 content::OpenURLParams params( 116 content::OpenURLParams params(
118 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)), 117 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)),
119 content::Referrer(), 118 content::Referrer(),
120 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 119 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
121 content::PAGE_TRANSITION_LINK, false); 120 content::PAGE_TRANSITION_LINK, false);
122 web_contents()->OpenURL(params); 121 web_contents()->OpenURL(params);
123 return false; // Do not dismiss the info bar. 122 return false; // Do not dismiss the info bar.
124 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698