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

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

Issue 1004063003: [Extensions] Add logic for when to show the toolbar redesign bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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_toolbar_model.h" 5 #include "chrome/browser/extensions/extension_toolbar_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 14 matching lines...) Expand all
25 #include "content/public/browser/notification_details.h" 25 #include "content/public/browser/notification_details.h"
26 #include "content/public/browser/notification_source.h" 26 #include "content/public/browser/notification_source.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "extensions/browser/extension_prefs.h" 28 #include "extensions/browser/extension_prefs.h"
29 #include "extensions/browser/extension_registry.h" 29 #include "extensions/browser/extension_registry.h"
30 #include "extensions/browser/extension_system.h" 30 #include "extensions/browser/extension_system.h"
31 #include "extensions/browser/pref_names.h" 31 #include "extensions/browser/pref_names.h"
32 #include "extensions/common/extension.h" 32 #include "extensions/common/extension.h"
33 #include "extensions/common/extension_set.h" 33 #include "extensions/common/extension_set.h"
34 #include "extensions/common/feature_switch.h" 34 #include "extensions/common/feature_switch.h"
35 #include "extensions/common/manifest_constants.h"
35 #include "extensions/common/one_shot_event.h" 36 #include "extensions/common/one_shot_event.h"
36 37
37 namespace extensions { 38 namespace extensions {
38 39
39 ExtensionToolbarModel::ExtensionToolbarModel(Profile* profile, 40 ExtensionToolbarModel::ExtensionToolbarModel(Profile* profile,
40 ExtensionPrefs* extension_prefs) 41 ExtensionPrefs* extension_prefs)
41 : profile_(profile), 42 : profile_(profile),
42 extension_prefs_(extension_prefs), 43 extension_prefs_(extension_prefs),
43 prefs_(profile_->GetPrefs()), 44 prefs_(profile_->GetPrefs()),
44 extensions_initialized_(false), 45 extensions_initialized_(false),
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 if (is_highlighting_) { 736 if (is_highlighting_) {
736 highlighted_items_.clear(); 737 highlighted_items_.clear();
737 is_highlighting_ = false; 738 is_highlighting_ = false;
738 if (old_visible_icon_count_ != visible_icon_count_) 739 if (old_visible_icon_count_ != visible_icon_count_)
739 SetVisibleIconCount(old_visible_icon_count_); 740 SetVisibleIconCount(old_visible_icon_count_);
740 FOR_EACH_OBSERVER(Observer, observers_, 741 FOR_EACH_OBSERVER(Observer, observers_,
741 OnToolbarHighlightModeChanged(false)); 742 OnToolbarHighlightModeChanged(false));
742 } 743 }
743 } 744 }
744 745
746 bool ExtensionToolbarModel::RedesignIsShowingNewIcons() const {
747 for (const scoped_refptr<const Extension>& extension : toolbar_items_) {
748 // Without the redesign, we only show extensions with browser actions.
749 // Any extension without a browser action is an indication that we're
750 // showing something new.
751 if (!extension->manifest()->HasKey(manifest_keys::kBrowserAction))
752 return true;
753 }
754 return false;
755 }
756
745 } // namespace extensions 757 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698