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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 12089102: Make most code on mac compile with enable_web_intents=0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ffff Created 7 years, 11 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/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index ee9bbe00f89f0e8518cb671dd3860212026d44b5..61d5895a87d243c6f09c80aec799815f5acb0256 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -108,8 +108,10 @@ LocationBarViewMac::LocationBarViewMac(
zoom_decoration_(new ZoomDecoration(toolbar_model)),
keyword_hint_decoration_(
new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())),
+#if defined(ENABLE_WEB_INTENTS)
web_intents_button_decoration_(
new WebIntentsButtonDecoration(this, OmniboxViewMac::GetFieldFont())),
+#endif
profile_(profile),
browser_(browser),
toolbar_model_(toolbar_model),
@@ -128,11 +130,13 @@ LocationBarViewMac::LocationBarViewMac(
new ContentSettingDecoration(type, this, profile_));
}
+#if defined(ENABLE_WEB_INTENTS)
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
web_intents_button_decoration_->SetButtonImages(
rb.GetNativeImageNamed(IDR_OMNIBOX_WI_BUBBLE_BACKGROUND_L).ToNSImage(),
rb.GetNativeImageNamed(IDR_OMNIBOX_WI_BUBBLE_BACKGROUND_C).ToNSImage(),
rb.GetNativeImageNamed(IDR_OMNIBOX_WI_BUBBLE_BACKGROUND_R).ToNSImage());
+#endif
registrar_.Add(this,
chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
@@ -242,9 +246,11 @@ void LocationBarViewMac::InvalidatePageActions() {
}
}
+#if defined(ENABLE_WEB_INTENTS)
void LocationBarViewMac::UpdateWebIntentsButton() {
RefreshWebIntentsButtonDecoration();
}
+#endif
void LocationBarViewMac::UpdateOpenPDFInReaderPrompt() {
// Not implemented on Mac.
@@ -667,6 +673,7 @@ void LocationBarViewMac::RefreshPageActionDecorations() {
}
void LocationBarViewMac::RefreshWebIntentsButtonDecoration() {
+#if defined(ENABLE_WEB_INTENTS)
WebContents* web_contents = GetWebContents();
if (!web_contents) {
web_intents_button_decoration_->SetVisible(false);
@@ -674,6 +681,7 @@ void LocationBarViewMac::RefreshWebIntentsButtonDecoration() {
}
web_intents_button_decoration_->Update(web_contents);
+#endif
}
// TODO(shess): This function should over time grow to closely match
@@ -705,7 +713,10 @@ void LocationBarViewMac::Layout() {
[cell addRightDecoration:keyword_hint_decoration_.get()];
+#if defined(ENABLE_WEB_INTENTS)
[cell addRightDecoration:web_intents_button_decoration_.get()];
+#endif
+
[cell addRightDecoration:separator_decoration_.get()];
[cell addRightDecoration:search_token_decoration_.get()];
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698