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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_close_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 #include "content/public/common/content_switches.h" 196 #include "content/public/common/content_switches.h"
197 #include "content/public/common/page_zoom.h" 197 #include "content/public/common/page_zoom.h"
198 #include "content/public/common/renderer_preferences.h" 198 #include "content/public/common/renderer_preferences.h"
199 #include "content/public/common/webplugininfo.h" 199 #include "content/public/common/webplugininfo.h"
200 #include "extensions/browser/extension_prefs.h" 200 #include "extensions/browser/extension_prefs.h"
201 #include "extensions/browser/extension_registry.h" 201 #include "extensions/browser/extension_registry.h"
202 #include "extensions/browser/extension_system.h" 202 #include "extensions/browser/extension_system.h"
203 #include "extensions/common/constants.h" 203 #include "extensions/common/constants.h"
204 #include "extensions/common/extension.h" 204 #include "extensions/common/extension.h"
205 #include "extensions/common/manifest_handlers/background_info.h" 205 #include "extensions/common/manifest_handlers/background_info.h"
206 #include "extensions/features/features.h"
206 #include "net/base/filename_util.h" 207 #include "net/base/filename_util.h"
207 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 208 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
208 #include "net/cookies/cookie_monster.h" 209 #include "net/cookies/cookie_monster.h"
209 #include "net/url_request/url_request_context.h" 210 #include "net/url_request/url_request_context.h"
210 #include "third_party/WebKit/public/web/WebWindowFeatures.h" 211 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
211 #include "ui/base/l10n/l10n_util.h" 212 #include "ui/base/l10n/l10n_util.h"
212 #include "ui/base/window_open_disposition.h" 213 #include "ui/base/window_open_disposition.h"
213 #include "ui/gfx/geometry/point.h" 214 #include "ui/gfx/geometry/point.h"
214 #include "ui/shell_dialogs/selected_file_info.h" 215 #include "ui/shell_dialogs/selected_file_info.h"
215 216
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 location_bar->UpdateContentSettingsIcons(); 2006 location_bar->UpdateContentSettingsIcons();
2006 } 2007 }
2007 break; 2008 break;
2008 } 2009 }
2009 2010
2010 default: 2011 default:
2011 NOTREACHED() << "Got a notification we didn't register for."; 2012 NOTREACHED() << "Got a notification we didn't register for.";
2012 } 2013 }
2013 } 2014 }
2014 2015
2015 #if defined(ENABLE_EXTENSIONS) 2016 #if BUILDFLAG(ENABLE_EXTENSIONS)
2016 /////////////////////////////////////////////////////////////////////////////// 2017 ///////////////////////////////////////////////////////////////////////////////
2017 // Browser, extensions::ExtensionRegistryObserver implementation: 2018 // Browser, extensions::ExtensionRegistryObserver implementation:
2018 2019
2019 void Browser::OnExtensionUninstalled(content::BrowserContext* browser_context, 2020 void Browser::OnExtensionUninstalled(content::BrowserContext* browser_context,
2020 const extensions::Extension* extension, 2021 const extensions::Extension* extension,
2021 extensions::UninstallReason reason) { 2022 extensions::UninstallReason reason) {
2022 // During window creation on Windows we may end up calling into 2023 // During window creation on Windows we may end up calling into
2023 // SHAppBarMessage, which internally spawns a nested message loop.This 2024 // SHAppBarMessage, which internally spawns a nested message loop.This
2024 // makes it possible for us to end up here before window creation has 2025 // makes it possible for us to end up here before window creation has
2025 // completed, at which point window_ is NULL. See 94752 for details. 2026 // completed, at which point window_ is NULL. See 94752 for details.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 web_contents->GetURL().host() == extension->id()) || 2060 web_contents->GetURL().host() == extension->id()) ||
2060 (extensions::TabHelper::FromWebContents(web_contents) 2061 (extensions::TabHelper::FromWebContents(web_contents)
2061 ->extension_app() == extension)) { 2062 ->extension_app() == extension)) {
2062 tab_strip_model_->CloseWebContentsAt(i, TabStripModel::CLOSE_NONE); 2063 tab_strip_model_->CloseWebContentsAt(i, TabStripModel::CLOSE_NONE);
2063 } else { 2064 } else {
2064 chrome::UnmuteIfMutedByExtension(web_contents, extension->id()); 2065 chrome::UnmuteIfMutedByExtension(web_contents, extension->id());
2065 } 2066 }
2066 } 2067 }
2067 } 2068 }
2068 } 2069 }
2069 #endif // defined(ENABLE_EXTENSIONS) 2070 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
2070 2071
2071 /////////////////////////////////////////////////////////////////////////////// 2072 ///////////////////////////////////////////////////////////////////////////////
2072 // Browser, translate::ContentTranslateDriver::Observer implementation: 2073 // Browser, translate::ContentTranslateDriver::Observer implementation:
2073 2074
2074 void Browser::OnIsPageTranslatedChanged(content::WebContents* source) { 2075 void Browser::OnIsPageTranslatedChanged(content::WebContents* source) {
2075 DCHECK(source); 2076 DCHECK(source);
2076 if (tab_strip_model_->GetActiveWebContents() == source) { 2077 if (tab_strip_model_->GetActiveWebContents() == source) {
2077 window_->SetTranslateIconToggled( 2078 window_->SetTranslateIconToggled(
2078 ChromeTranslateClient::FromWebContents( 2079 ChromeTranslateClient::FromWebContents(
2079 source)->GetLanguageState().IsPageTranslated()); 2080 source)->GetLanguageState().IsPageTranslated());
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 if (contents && !allow_js_access) { 2596 if (contents && !allow_js_access) {
2596 contents->web_contents()->GetController().LoadURL( 2597 contents->web_contents()->GetController().LoadURL(
2597 target_url, 2598 target_url,
2598 content::Referrer(), 2599 content::Referrer(),
2599 ui::PAGE_TRANSITION_LINK, 2600 ui::PAGE_TRANSITION_LINK,
2600 std::string()); // No extra headers. 2601 std::string()); // No extra headers.
2601 } 2602 }
2602 2603
2603 return contents != NULL; 2604 return contents != NULL;
2604 } 2605 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_close_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698