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

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

Issue 664553007: Cleanup: Put more chrome/ code behind ENABLE_EXTENSIONS ifdefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix android Created 6 years, 2 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_commands.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 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 location_bar->UpdateContentSettingsIcons(); 1973 location_bar->UpdateContentSettingsIcons();
1974 } 1974 }
1975 break; 1975 break;
1976 } 1976 }
1977 1977
1978 default: 1978 default:
1979 NOTREACHED() << "Got a notification we didn't register for."; 1979 NOTREACHED() << "Got a notification we didn't register for.";
1980 } 1980 }
1981 } 1981 }
1982 1982
1983 #if defined(ENABLE_EXTENSIONS)
1983 /////////////////////////////////////////////////////////////////////////////// 1984 ///////////////////////////////////////////////////////////////////////////////
1984 // Browser, extensions::ExtensionRegistryObserver implementation: 1985 // Browser, extensions::ExtensionRegistryObserver implementation:
1985 1986
1986 void Browser::OnExtensionUninstalled(content::BrowserContext* browser_context, 1987 void Browser::OnExtensionUninstalled(content::BrowserContext* browser_context,
1987 const extensions::Extension* extension, 1988 const extensions::Extension* extension,
1988 extensions::UninstallReason reason) { 1989 extensions::UninstallReason reason) {
1989 // During window creation on Windows we may end up calling into 1990 // During window creation on Windows we may end up calling into
1990 // SHAppBarMessage, which internally spawns a nested message loop.This 1991 // SHAppBarMessage, which internally spawns a nested message loop.This
1991 // makes it possible for us to end up here before window creation has 1992 // makes it possible for us to end up here before window creation has
1992 // completed, at which point window_ is NULL. See 94752 for details. 1993 // completed, at which point window_ is NULL. See 94752 for details.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 // installed. 2038 // installed.
2038 if ((web_contents->GetURL().SchemeIs(extensions::kExtensionScheme) && 2039 if ((web_contents->GetURL().SchemeIs(extensions::kExtensionScheme) &&
2039 web_contents->GetURL().host() == extension->id()) || 2040 web_contents->GetURL().host() == extension->id()) ||
2040 (extensions::TabHelper::FromWebContents(web_contents) 2041 (extensions::TabHelper::FromWebContents(web_contents)
2041 ->extension_app() == extension)) { 2042 ->extension_app() == extension)) {
2042 tab_strip_model_->CloseWebContentsAt(i, TabStripModel::CLOSE_NONE); 2043 tab_strip_model_->CloseWebContentsAt(i, TabStripModel::CLOSE_NONE);
2043 } 2044 }
2044 } 2045 }
2045 } 2046 }
2046 } 2047 }
2048 #endif // defined(ENABLE_EXTENSIONS)
2047 2049
2048 /////////////////////////////////////////////////////////////////////////////// 2050 ///////////////////////////////////////////////////////////////////////////////
2049 // Browser, Command and state updating (private): 2051 // Browser, Command and state updating (private):
2050 2052
2051 void Browser::OnDevToolsDisabledChanged() { 2053 void Browser::OnDevToolsDisabledChanged() {
2052 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) 2054 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled))
2053 content::DevToolsAgentHost::DetachAllClients(); 2055 content::DevToolsAgentHost::DetachAllClients();
2054 } 2056 }
2055 2057
2056 /////////////////////////////////////////////////////////////////////////////// 2058 ///////////////////////////////////////////////////////////////////////////////
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 if (contents && !allow_js_access) { 2495 if (contents && !allow_js_access) {
2494 contents->web_contents()->GetController().LoadURL( 2496 contents->web_contents()->GetController().LoadURL(
2495 target_url, 2497 target_url,
2496 content::Referrer(), 2498 content::Referrer(),
2497 ui::PAGE_TRANSITION_LINK, 2499 ui::PAGE_TRANSITION_LINK,
2498 std::string()); // No extra headers. 2500 std::string()); // No extra headers.
2499 } 2501 }
2500 2502
2501 return contents != NULL; 2503 return contents != NULL;
2502 } 2504 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698