zoukankan      html  css  js  c++  java
  • 【技术应用】visual studio 2010 + chromium 更改代码 去掉地址栏

    看着ie9 firefox opera都效仿tab风格,对比了下,chrome的窗口上面部分还不够小,

    干脆把地址栏去掉,F10ALT键,显示隐藏地址栏,

    这里是我编译好的程序,喜欢的拿走(26M)

    chrome_notoobar_V12.part1

    chrome_notoobar_V12.part2 


    研究了下代码,更改如下:

     

    1、src\chrome\browser\ui\browser.h中

     

    //加入一个变量,记录当前 toolbar的显示状态

    bool toolbar_visible_;

     

     

    2、src\chrome\browser\ui\browser.cc中

     

    //构造函数中,给变量赋值

    Browser::Browser(Type type, Profile* profile)

        : type_(type),

     toolbar_visible_(false),

     ...

     

    ---------------------------------------------

    //修改SupportsWindowFeatureImpl函数中代码

    bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,

                                            bool check_fullscreen) const {

        ...

        if (type() == TYPE_NORMAL && toolbar_visible_==true)

          features |= FEATURE_TOOLBAR;

     

        if ((type() & Browser::TYPE_APP ) == 0 && toolbar_visible_==true)

          features |= FEATURE_LOCATIONBAR;

        ...

    ---------------------------------------------

    //FocusAppMenu函数中修改代码

    void Browser::FocusAppMenu() {

     UserMetrics::RecordAction(UserMetricsAction("FocusAppMenu"), profile_);

     //:ningth

     toolbar_visible_ = !toolbar_visible_;

     window_->FocusAppMenu();

    }

     

    3、src\chrome\browser\ui\views\frame\browser_view.cc中

    //修改FocusAppMenu中代码

    void BrowserView::FocusAppMenu() {

     // Chrome doesn't have a traditional menu bar, but it has a menu button in the

     // main toolbar that plays the same role. If the user presses a key that

     // would typically focus the menu bar, tell the toolbar to focus the menu

     // button. If the user presses the key again, return focus to the previous

     // location.

     //

     // Not used on the Mac, which has a normal menu bar.

     

     //:ningth

     Layout();

     

     SetFocusToLocationBar(true);

     /*if (toolbar_->IsAppMenuFocused()) {

        RestoreFocus();

     } else {

        SaveFocusedView();

        toolbar_->SetPaneFocusAndFocusAppMenu(last_focused_view_storage_id_);

     }*/

    }

     

     

    4、src\chrome\browser\ui\views\frame\browser_view_layout.cc中

    修改LayoutToolbar函数中的height值

    int BrowserViewLayout::LayoutToolbar(int top) {

     int browser_view_width = vertical_layout_rect_.width();

     bool visible = browser_view_->IsToolbarVisible();;

     toolbar_->location_bar()->SetFocusable(visible);

     int y = top;

     if (!browser_view_->UseVerticalTabs()) {

        y -= ((visible && browser_view_->IsTabStripVisible()) ?

              kToolbarTabStripVerticalOverlap : 0);

     }

     int height = visible ? toolbar_->GetPreferredSize().height() : 1;

     toolbar_->SetVisible(visible);

     toolbar_->SetBounds(vertical_layout_rect_.x(), y, browser_view_width, height);

     

     return y + height;

    }

  • 相关阅读:
    bzoj 4008 亚瑟王 期望概率dp
    t[..., 1, tf.newaxis]
    Keras learning_phase()和learning_phase_scope()
    Keras Sequential模型和add()
    Keras克隆层
    Keras搭建一个Wide & Deep 神经网络
    1 链表的数据结构
    海康威视2017软件精英挑战赛初赛题目
    2016年倒计时两天
    可自定义片头的腾讯视频无广告可全屏调用代码
  • 原文地址:https://www.cnblogs.com/ningth/p/2008747.html
Copyright © 2011-2022 走看看