chromium 去掉地址登录和实验按钮

嗯....登录按钮的关键字是Avatar 

对于这个按钮的绑定的功能

在chromium\src\chrome\browser\ui\views\frame\browser_view.cc

void BrowserView::ShowAvatarBubbleFromAvatarButton(
    AvatarBubbleMode mode,
    signin_metrics::AccessPoint access_point,
    bool focus_first_profile_button) {
//  // Do not show avatar bubble if there is no avatar menu button.
//  views::Button* avatar_button =
//      toolbar_button_provider_->GetAvatarToolbarButton();
//  if (!avatar_button)
//    return;
//
//  profiles::BubbleViewMode bubble_view_mode;
//  profiles::BubbleViewModeFromAvatarBubbleMode(mode, GetProfile(),
//                                               &bubble_view_mode);
//#if !BUILDFLAG(IS_CHROMEOS_ASH)
//  if (SigninViewController::ShouldShowSigninForMode(bubble_view_mode)) {
//    browser_->signin_view_controller()->ShowSignin(bubble_view_mode,
//                                                   access_point);
//    return;
//  }
//#endif
//  ProfileMenuViewBase::ShowBubble(bubble_view_mode, avatar_button, browser(),
//                                  focus_first_profile_button);
}

 

去掉设置里面的你与goole在

chromium\src\chrome\browser\resources\settings\basic_page\basic_page.html:

<!--
        <template is="dom-if" if="[[showPage_(pageVisibility.people)]]" restamp>
          <settings-section page-title="$i18n{peoplePageTitle}"
              section="people">
            <settings-people-page prefs="{{prefs}}"
                page-visibility="[[pageVisibility]]">
            </settings-people-page>
          </settings-section>
        </template>
-->

但是。。。。这并没有达到我们的效果

后来发现在chromium\src\chrome\browser\ui\views\toolbar\toolbar_view.cc

这个就是取消菜单栏和登录按钮的绑定

  //if (toolbar_account_icon_container) {
  //  toolbar_account_icon_container_ =
  //      AddChildView(std::move(toolbar_account_icon_container));
  //  avatar_ = toolbar_account_icon_container_->avatar_button();
  //} else {
  //  // TODO(crbug.com/932818): Remove this once the
  //  // |kAutofillEnableToolbarStatusChip| is fully launched.
  //  avatar_ = AddChildView(std::make_unique<AvatarToolbarButton>(browser_));
  //  avatar_->SetVisible(show_avatar_toolbar_button);
  //}

 

同样,去掉实验按钮

  //if (base::FeatureList::IsEnabled(features::kChromeLabs)) {
  //  chrome_labs_model_ = std::make_unique<ChromeLabsBubbleViewModel>();
  //  if (ChromeLabsButton::ShouldShowButton(chrome_labs_model_.get())) {
  //    chrome_labs_button_ = AddChildView(
  //        std::make_unique<ChromeLabsButton>(chrome_labs_model_.get()));
  //    profile_pref_service_ = browser_->profile()->GetPrefs();
  //    profile_registrar_ = std::make_unique<PrefChangeRegistrar>();
  //    profile_registrar_->Init(profile_pref_service_);
  //    profile_registrar_->Add(
  //        chrome_labs_prefs::kBrowserLabsEnabled,
  //        base::BindRepeating(&ToolbarView::OnChromeLabsPrefChanged,
  //                            base::Unretained(this)));
  //    OnChromeLabsPrefChanged();
  //  }
  //}
 

 

posted @ 2021-05-11 13:52  冰糖葫芦很乖  阅读(625)  评论(0编辑  收藏  举报