summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 21:29:26 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 21:29:26 +0000
commitb7969209a311ca384eceacef7d67743f2ffd792d (patch)
treed64c91438914c09f4389c9edf99ff29f1a8c7dbf /chrome/browser/chromeos
parent0805a9b30d8cf935a572fe093a74f6784c6e4689 (diff)
downloadchromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.zip
chromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.tar.gz
chromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.tar.bz2
Removing the app launcher button in the ChromeOS browser and making the app launcher pinned to the location bar.
BUG=3190 TEST=The app launcher icon on the top-left corner of the browser should be gone. Opening a new tab by pressing the + button or typing CTRL-T should bring the app launcher, it should be located on top of the location bar. Review URL: http://codereview.chromium.org/2060004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/frame/browser_view.cc47
-rw-r--r--chrome/browser/chromeos/frame/browser_view.h12
-rw-r--r--chrome/browser/chromeos/view_ids.h4
3 files changed, 7 insertions, 56 deletions
diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc
index 761459c..1eac964 100644
--- a/chrome/browser/chromeos/frame/browser_view.cc
+++ b/chrome/browser/chromeos/frame/browser_view.cc
@@ -122,9 +122,9 @@ class ChromeosTabStrip : public TabStrip {
namespace chromeos {
// LayoutManager for BrowserView, which layouts extra components such as
-// main menu, stataus views as follows:
-// ____ __ __
-// [AppLauncher] / \ \ \ [StatusArea]
+// the status views as follows:
+// ____ __ __
+// / \ \ \ [StatusArea]
//
class BrowserViewLayout : public ::BrowserViewLayout {
public:
@@ -135,7 +135,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
// BrowserViewLayout overrides:
void Installed(views::View* host) {
- main_menu_button_ = NULL;
compact_navigation_bar_ = NULL;
status_area_ = NULL;
spacer_ = NULL;
@@ -149,9 +148,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
case VIEW_ID_SPACER:
spacer_ = view;
break;
- case VIEW_ID_APP_MENU_BUTTON:
- main_menu_button_ = view;
- break;
case VIEW_ID_STATUS_AREA:
status_area_ = static_cast<chromeos::StatusAreaView*>(view);
break;
@@ -170,7 +166,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
virtual int LayoutTabStrip() {
if (browser_view_->IsFullscreen() ||
!browser_view_->IsTabStripVisible()) {
- main_menu_button_->SetVisible(false);
compact_navigation_bar_->SetVisible(false);
status_area_->SetVisible(false);
otr_avatar_icon_->SetVisible(false);
@@ -211,12 +206,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
// considered title bar area of client view.
bool IsPointInViewsInTitleArea(const gfx::Point& point)
const {
- gfx::Point point_in_main_menu_coords(point);
- views::View::ConvertPointToView(browser_view_, main_menu_button_,
- &point_in_main_menu_coords);
- if (main_menu_button_->HitTest(point_in_main_menu_coords))
- return true;
-
gfx::Point point_in_status_area_coords(point);
views::View::ConvertPointToView(browser_view_, status_area_,
&point_in_status_area_coords);
@@ -241,7 +230,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
if (bounds.IsEmpty()) {
return 0;
}
- main_menu_button_->SetVisible(true);
compact_navigation_bar_->SetVisible(
chromeos_browser_view()->is_compact_style());
tabstrip_->SetVisible(true);
@@ -263,11 +251,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
}
*/
- // Layout main menu before tab strip.
- gfx::Size main_menu_size = main_menu_button_->GetPreferredSize();
- main_menu_button_->SetBounds(0, bounds.y(),
- main_menu_size.width(), bounds.height());
-
status_area_->Update();
// Layout status area after tab strip.
gfx::Size status_size = status_area_->GetPreferredSize();
@@ -276,7 +259,7 @@ class BrowserViewLayout : public ::BrowserViewLayout {
status_size.height());
LayoutOTRAvatar(bounds);
- int curx = bounds.x() + main_menu_size.width();
+ int curx = bounds.x();
if (compact_navigation_bar_->IsVisible()) {
gfx::Size cnb_size = compact_navigation_bar_->GetPreferredSize();
@@ -326,7 +309,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
}
- views::View* main_menu_button_;
chromeos::StatusAreaView* status_area_;
views::View* compact_navigation_bar_;
views::View* spacer_;
@@ -337,7 +319,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
BrowserView::BrowserView(Browser* browser)
: ::BrowserView(browser),
- main_menu_button_(NULL),
status_area_(NULL),
compact_navigation_bar_(NULL),
// Standard style is default.
@@ -356,15 +337,8 @@ BrowserView::~BrowserView() {
void BrowserView::Init() {
::BrowserView::Init();
- main_menu_button_ = new views::ImageButton(this);
- main_menu_button_->SetID(VIEW_ID_APP_MENU_BUTTON);
ThemeProvider* theme_provider =
frame()->GetThemeProviderForFrame();
- SkBitmap* image = theme_provider->GetBitmapNamed(IDR_APP_LAUNCHER_BUTTON);
- main_menu_button_->SetImage(views::CustomButton::BS_NORMAL, image);
- main_menu_button_->SetImage(views::CustomButton::BS_HOT, image);
- main_menu_button_->SetImage(views::CustomButton::BS_PUSHED, image);
- AddChildView(main_menu_button_);
compact_location_bar_host_.reset(
new chromeos::CompactLocationBarHost(this));
@@ -452,19 +426,6 @@ void BrowserView::ChildPreferredSizeChanged(View* child) {
SchedulePaint();
}
-// views::ButtonListener overrides.
-void BrowserView::ButtonPressed(views::Button* sender,
- const views::Event& event) {
- gfx::Rect bounds = main_menu_button_->bounds();
- gfx::Point origin = bounds.origin();
- // Move the origin to the right otherwise the app launcher info bubble left
- // border will show out of screen.
- origin.Offset(kAppLauncherLeftPadding, 0);
- views::RootView::ConvertPointToScreen(this, &origin);
- bounds.set_origin(origin);
- ::AppLauncher::Show(browser(), bounds, gfx::Point(), std::string());
-}
-
// views::ContextMenuController overrides.
void BrowserView::ShowContextMenu(views::View* source,
const gfx::Point& p,
diff --git a/chrome/browser/chromeos/frame/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h
index 49c0daa..2a414bd 100644
--- a/chrome/browser/chromeos/frame/browser_view.h
+++ b/chrome/browser/chromeos/frame/browser_view.h
@@ -7,7 +7,6 @@
#include "chrome/browser/chromeos/status/status_area_host.h"
#include "chrome/browser/views/frame/browser_view.h"
-#include "views/controls/button/button.h"
class TabStripModel;
@@ -33,12 +32,11 @@ class StatusAreaButton;
// chromeos::BrowserView adds ChromeOS specific controls and menus to a
// BrowserView created with Browser::TYPE_NORMAL. This extender adds controls
// to the title bar as follows:
-// ____ __ __
-// [AppLauncher] / \ \ \ [StatusArea]
+// ____ __ __
+// / \ \ \ [StatusArea]
//
// and adds the system context menu to the remaining arae of the titlebar.
class BrowserView : public ::BrowserView,
- public views::ButtonListener,
public views::ContextMenuController,
public StatusAreaHost {
public:
@@ -66,9 +64,6 @@ class BrowserView : public ::BrowserView,
virtual views::LayoutManager* CreateLayoutManager() const;
virtual void ChildPreferredSizeChanged(View* child);
- // views::ButtonListener overrides.
- virtual void ButtonPressed(views::Button* sender, const views::Event& event);
-
// views::ContextMenuController overrides.
virtual void ShowContextMenu(views::View* source,
const gfx::Point& p,
@@ -100,9 +95,6 @@ class BrowserView : public ::BrowserView,
void InitSystemMenu();
- // AppLauncher button.
- views::ImageButton* main_menu_button_;
-
// Status Area view.
BrowserStatusAreaView* status_area_;
diff --git a/chrome/browser/chromeos/view_ids.h b/chrome/browser/chromeos/view_ids.h
index 54b3b7b..803b8fe 100644
--- a/chrome/browser/chromeos/view_ids.h
+++ b/chrome/browser/chromeos/view_ids.h
@@ -11,12 +11,10 @@
enum ChromeOSViewIds {
// Start with the offset that is big enough to avoid possible
// collison.
- VIEW_ID_APP_MENU_BUTTON = VIEW_ID_PREDEFINED_COUNT + 10000,
- VIEW_ID_COMPACT_NAV_BAR,
+ VIEW_ID_COMPACT_NAV_BAR = VIEW_ID_PREDEFINED_COUNT + 10000,
VIEW_ID_STATUS_AREA,
VIEW_ID_SPACER,
VIEW_ID_OTR_AVATAR,
};
#endif // CHROME_BROWSER_CHROMEOS_VIEW_IDS_H_
-