summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-17 00:25:49 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-17 00:25:49 +0000
commit68b8b022d6e13600abcd680886d9bacbdf672a2b (patch)
treedd9de19c01243292d308084e645f1d03a2103947 /chrome
parent272cfa02655aeb460d99c6b5c913b01c26bc6dfc (diff)
downloadchromium_src-68b8b022d6e13600abcd680886d9bacbdf672a2b.zip
chromium_src-68b8b022d6e13600abcd680886d9bacbdf672a2b.tar.gz
chromium_src-68b8b022d6e13600abcd680886d9bacbdf672a2b.tar.bz2
fixes for
crash/non responsive issue in compact navbar. crash when adding tab. new command line switch to start chrome in chromeos layout. changed accelerator to toggle compact navbar to ctrl-shit-c. -0 does not work on chromeos for some reason. BUG=chromium-os:1010, 30612 TEST=None Review URL: http://codereview.chromium.org/500043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/browser_extenders.cc22
-rw-r--r--chrome/browser/views/accelerator_table_gtk.cc2
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc3
-rw-r--r--chrome/common/chrome_switches.cc11
-rw-r--r--chrome/common/chrome_switches.h1
5 files changed, 29 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/browser_extenders.cc b/chrome/browser/chromeos/browser_extenders.cc
index 910bbe9..dbf9acb 100644
--- a/chrome/browser/chromeos/browser_extenders.cc
+++ b/chrome/browser/chromeos/browser_extenders.cc
@@ -6,6 +6,7 @@
#include "app/menus/simple_menu_model.h"
#include "app/theme_provider.h"
+#include "base/command_line.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/chromeos/compact_location_bar.h"
#include "chrome/browser/chromeos/compact_navigation_bar.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/views/tabs/tab_overview_types.h"
#include "chrome/browser/views/tabs/tab_strip.h"
#include "chrome/browser/views/toolbar_view.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/x11_util.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -97,7 +99,9 @@ class NormalExtender : public BrowserExtender,
// means it's possible for us not to be able to get the name of the window
// manager. We assume that when this happens we're on Chrome OS.
force_maximized_window_ = (!wm_name_valid ||
- wm_name == kChromeOsWindowManagerName);
+ wm_name == kChromeOsWindowManagerName ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kChromeosFrame));
}
}
@@ -115,11 +119,18 @@ class NormalExtender : public BrowserExtender,
status_area_->SetVisible(true);
}
+ /* TODO(oshima):
+ * Disabling the ability to update location bar on re-layout bacause
+ * tabstrip state may not be in sync with the browser's state when
+ * new tab is added. We should decide when we know more about this
+ * feature. May be we should simply hide the location?
+ * Filed a bug: http://crbug.com/30612.
if (compact_navigation_bar_->IsVisible()) {
// Update the size and location of the compact location bar.
compact_location_bar_->UpdateBounds(
browser_view()->tabstrip()->GetSelectedTab());
}
+ */
// Layout main menu before tab strip.
gfx::Size main_menu_size = main_menu_->GetPreferredSize();
@@ -136,8 +147,13 @@ class NormalExtender : public BrowserExtender,
if (compact_navigation_bar_->IsVisible()) {
gfx::Size cnb_bounds = compact_navigation_bar_->GetPreferredSize();
- compact_navigation_bar_->SetBounds(curx, bounds.y(),
- cnb_bounds.width(), bounds.height());
+ // This (+1/-1) is a quick hack for the bug
+ // http://code.google.com/p/chromium-os/issues/detail?id=1010
+ // while investigating the issue. It could be in gtk or around
+ // NativeViewHostGtk::CreateFixed, but it will take some time.
+ compact_navigation_bar_->SetBounds(curx, bounds.y() + 1,
+ cnb_bounds.width(),
+ bounds.height() - 1);
curx += cnb_bounds.width();
width -= cnb_bounds.width();
}
diff --git a/chrome/browser/views/accelerator_table_gtk.cc b/chrome/browser/views/accelerator_table_gtk.cc
index 3c28ee3..057e0c5 100644
--- a/chrome/browser/views/accelerator_table_gtk.cc
+++ b/chrome/browser/views/accelerator_table_gtk.cc
@@ -124,7 +124,7 @@ const AcceleratorMapping kAcceleratorMap[] = {
{ base::VKEY_B, true, true, false, IDC_SHOW_BOOKMARK_MANAGER },
{ base::VKEY_F1, false, false, false, IDC_HELP_PAGE },
{ base::VKEY_Q, true, true, false, IDC_EXIT },
- { base::VKEY_0, true, true, false, IDC_COMPACT_NAVBAR },
+ { base::VKEY_C, true, true, false, IDC_COMPACT_NAVBAR },
{ base::VKEY_F, false, false, true, IDC_SHOW_APP_MENU},
{ base::VKEY_E, false, false, true, IDC_SHOW_PAGE_MENU},
};
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 6b48df7..30a7cac 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -1415,7 +1415,8 @@ void TabStrip::LoadNewTabButtonImage() {
}
Tab* TabStrip::GetTabAt(int index) const {
- DCHECK(index >= 0 && index < GetTabCount());
+ DCHECK_GE(index, 0);
+ DCHECK_LT(index, GetTabCount());
return tab_data_.at(index).tab;
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 64ab2ee..9c6dcb8 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -449,11 +449,6 @@ const char kProcessPerSite[] = "process-per-site";
// script connections to each other).
const char kProcessPerTab[] = "process-per-tab";
-#if defined(OS_CHROMEOS)
-// Overrides the Default profile.
-const char kProfile[] = "profile";
-#endif
-
// Causes the process to run as a profile import subprocess.
const char kProfileImportProcess[] = "profile-import";
@@ -681,6 +676,12 @@ const char kLoginManager[] = "login-manager";
// Attempts to load libcros and validate it, then exits. A nonzero return code
// means the library could not be loaded correctly.
const char kTestLoadLibcros[] = "test-load-libcros";
+
+// Overrides the Default profile.
+const char kProfile[] = "profile";
+
+// Use the frame layout used in chromeos.
+const char kChromeosFrame[] = "chromeos-frame";
#endif
#if defined(OS_LINUX)
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 4e9e702..fea4fdc 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -195,6 +195,7 @@ extern const char kEnableGView[];
extern const char kLoginManager[];
extern const char kTestLoadLibcros[];
extern const char kProfile[];
+extern const char kChromeosFrame[];
#endif
#if defined(OS_LINUX)