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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 9315007: Make the Chrome Web Store Icon Syncable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responding to comments Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/pending_extension_manager.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 return true; 1576 return true;
1577 1577
1578 // Check the prefs. 1578 // Check the prefs.
1579 return extension_prefs_->IsIncognitoEnabled(extension_id); 1579 return extension_prefs_->IsIncognitoEnabled(extension_id);
1580 } 1580 }
1581 1581
1582 void ExtensionService::SetIsIncognitoEnabled( 1582 void ExtensionService::SetIsIncognitoEnabled(
1583 const std::string& extension_id, bool enabled) { 1583 const std::string& extension_id, bool enabled) {
1584 const Extension* extension = GetInstalledExtension(extension_id); 1584 const Extension* extension = GetInstalledExtension(extension_id);
1585 if (extension && extension->location() == Extension::COMPONENT) { 1585 if (extension && extension->location() == Extension::COMPONENT) {
1586 // This shouldn't be called for component extensions. 1586 // This shouldn't be called for component extensions other than the
1587 NOTREACHED(); 1587 // web store (which is consider an app, and may try to set this value).
Finnur 2012/02/03 15:12:52 nit: consider->considered.
csharp 2012/02/03 15:19:20 Done.
1588 DCHECK_EQ(extension_id, extension_misc::kWebStoreAppId);
1589
1590 // If we are here with the CWS, make sure the we aren't trying to
1591 // change it.
1592 DCHECK_EQ(enabled, IsIncognitoEnabled(extension_id));
1593
1588 return; 1594 return;
1589 } 1595 }
1590 1596
1591 // Broadcast unloaded and loaded events to update browser state. Only bother 1597 // Broadcast unloaded and loaded events to update browser state. Only bother
1592 // if the value changed and the extension is actually enabled, since there is 1598 // if the value changed and the extension is actually enabled, since there is
1593 // no UI otherwise. 1599 // no UI otherwise.
1594 bool old_enabled = extension_prefs_->IsIncognitoEnabled(extension_id); 1600 bool old_enabled = extension_prefs_->IsIncognitoEnabled(extension_id);
1595 if (enabled == old_enabled) 1601 if (enabled == old_enabled)
1596 return; 1602 return;
1597 1603
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 // 2708 //
2703 // To coexist with certain unit tests that don't have an IO thread message 2709 // To coexist with certain unit tests that don't have an IO thread message
2704 // loop available at ExtensionService shutdown, we lazy-initialize this 2710 // loop available at ExtensionService shutdown, we lazy-initialize this
2705 // object so that those cases neither create nor destroy a SocketController. 2711 // object so that those cases neither create nor destroy a SocketController.
2706 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2712 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2707 if (!socket_controller_) { 2713 if (!socket_controller_) {
2708 socket_controller_ = new extensions::SocketController(); 2714 socket_controller_ = new extensions::SocketController();
2709 } 2715 }
2710 return socket_controller_; 2716 return socket_controller_;
2711 } 2717 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/pending_extension_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698