diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 00:16:40 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 00:16:40 +0000 |
commit | a3354454938083e933e2c988777a1c53d94b4277 (patch) | |
tree | 5cbfca015873e7c56eccefe80d1a979e500b33cb /chrome/browser/app_menu_model.h | |
parent | 50a376f0d18e4f76a3ab04c46c66df965b6b2192 (diff) | |
download | chromium_src-a3354454938083e933e2c988777a1c53d94b4277.zip chromium_src-a3354454938083e933e2c988777a1c53d94b4277.tar.gz chromium_src-a3354454938083e933e2c988777a1c53d94b4277.tar.bz2 |
Rebuild app menu in ToolbarView::RunAppMenu
When "enable-udd-profiles" switch is set, update profile submenu and
rebuild app menu if necessary.
BUG=30417
TEST=Verify that comment 5 in issue 30417 is fixed.
Review URL: http://codereview.chromium.org/571015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_menu_model.h')
-rw-r--r-- | chrome/browser/app_menu_model.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/chrome/browser/app_menu_model.h b/chrome/browser/app_menu_model.h index a3d7e0e..b0daac7 100644 --- a/chrome/browser/app_menu_model.h +++ b/chrome/browser/app_menu_model.h @@ -1,10 +1,13 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef CHROME_BROWSER_APP_MENU_MODEL_H_ #define CHROME_BROWSER_APP_MENU_MODEL_H_ +#include <set> +#include <vector> + #include "app/menus/simple_menu_model.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" @@ -24,9 +27,14 @@ class AppMenuModel : public menus::SimpleMenuModel { virtual bool IsLabelDynamicAt(int index) const; virtual string16 GetLabelAt(int index) const; + // Build/update profile submenu. Return true if profiles submenu is built or + // updated. False otherwise. + bool BuildProfileSubMenu(); + private: void Build(); - void BuildProfileSubMenu(); + + bool ProfilesChanged(const std::vector<std::wstring>& profiles) const; string16 GetSyncMenuLabel() const; bool IsSyncItem(int index) const; @@ -34,6 +42,10 @@ class AppMenuModel : public menus::SimpleMenuModel { // Contents of the profiles menu to populate with profile names. scoped_ptr<menus::SimpleMenuModel> profiles_menu_contents_; + // Profile names that are in profiles_menu_contents_. This is used to + // detect profile change. + std::vector<std::wstring> known_profiles_; + Browser* browser_; // weak DISALLOW_COPY_AND_ASSIGN(AppMenuModel); |