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

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: Update CastBrowserContext 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
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..484c82f8e3750d62fdbcd7290945a58457ded687 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
+
Avi (use Gerrit) 2017/05/10 21:57:46 Is this extensions-only? I thought that this was a
Kevin McNee 2017/05/11 15:11:54 Yeah, the PDF viewer uses GuestViews (specifically
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)
msw 2017/05/12 18:06:32 nit: two spaces before comment?
Kevin McNee 2017/05/15 20:02:10 So clang-format insists on using 3 spaces followin
Kevin McNee 2017/05/15 21:44:20 FYI: I've filled a bug about this. crbug.com/72256
+ 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)
msw 2017/05/12 18:06:32 ditto nit: two spaces before comment?
+ return false;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698