Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3397)

Unified Diff: chrome/browser/ui/views/frame/browser_view_layout.cc

Issue 10823414: Also hide incognito switcher when no regular window is available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OWNER review comments addressed. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view_layout.cc
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index 7cbee7689a121c9aeb1ee3972f484accd9b1e9db..e58e090bb074a97e6389f9653c2ce92fc5a4705b 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/frame/browser_view_layout.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/view_ids.h"
@@ -320,11 +321,15 @@ int BrowserViewLayout::LayoutTabStripRegion() {
// The metro window switcher sits at the far right edge of the tabstrip
// a |kWindowSwitcherOffsetX| pixels from the right edge.
- // Only visible if there is an incognito window because switching between
- // regular and incognito windows is the only use case that works right now.
+ // Only visible if there is more than one type of window to switch between.
+ // TODO(mad): update this code when more window types than just incognito
+ // and regular are available.
views::Button* switcher_button = browser_view_->window_switcher_button_;
if (switcher_button) {
- if (browser_view_->browser()->profile()->HasOffTheRecordProfile()) {
+ if (browser()->profile()->HasOffTheRecordProfile() &&
+ browser::FindBrowserWithProfile(
+ browser()->profile()->GetOriginalProfile(),
+ browser()->host_desktop_type()) != NULL) {
switcher_button->SetVisible(true);
int width = browser_view_->width();
gfx::Size ps = switcher_button->GetPreferredSize();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698