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

Unified Diff: chrome/browser/ui/tab_contents/core_tab_helper.cc

Issue 2874833002: Don't compile code for desktop zoom or GuestViews on mobile platforms. (Closed)
Patch Set: Rebase. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tab_contents/core_tab_helper.cc
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc
index e017f214e843307009591e31496569c3c6977f62..ac3e496fd7acbe8229201729ea10088161b315aa 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.cc
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc
@@ -22,7 +22,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/thumbnail_capturer.mojom.h"
#include "chrome/grit/generated_resources.h"
-#include "components/guest_view/browser/guest_view_manager.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "components/strings/grit/components_strings.h"
@@ -44,6 +43,10 @@
#include "chrome/browser/ui/browser.h"
#endif
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "components/guest_view/browser/guest_view_manager.h"
+#endif
+
using content::WebContents;
namespace {
@@ -129,10 +132,13 @@ bool CoreTabHelper::GetStatusTextForWebContents(
tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"467185 CoreTabHelper::GetStatusTextForWebContents1"));
+#if BUILDFLAG(ENABLE_EXTENSIONS)
auto* guest_manager = guest_view::GuestViewManager::FromBrowserContext(
source->GetBrowserContext());
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
if (!source->IsLoading() ||
source->GetLoadState().state == net::LOAD_STATE_IDLE) {
+#if BUILDFLAG(ENABLE_EXTENSIONS)
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185
// is fixed.
tracked_objects::ScopedTracker tracking_profile2(
@@ -143,6 +149,9 @@ bool CoreTabHelper::GetStatusTextForWebContents(
return guest_manager->ForEachGuest(
source, base::Bind(&CoreTabHelper::GetStatusTextForWebContents,
status_text));
+#else // !BUILDFLAG(ENABLE_EXTENSIONS)
+ return false;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/467185
@@ -226,6 +235,7 @@ bool CoreTabHelper::GetStatusTextForWebContents(
case net::LOAD_STATE_READING_RESPONSE:
break;
}
+#if BUILDFLAG(ENABLE_EXTENSIONS)
if (!guest_manager)
return false;
@@ -237,6 +247,9 @@ bool CoreTabHelper::GetStatusTextForWebContents(
return guest_manager->ForEachGuest(
source, base::Bind(&CoreTabHelper::GetStatusTextForWebContents,
status_text));
+#else // !BUILDFLAG(ENABLE_EXTENSIONS)
+ return false;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698