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

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: Now with the API available, so that we can run try bots... 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 08d7769837f299ba8524c2c974d358f89bbd2f2e..0034f4bd3c851862695ee17f57b5394b1984916d 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"
@@ -319,11 +320,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 both an incognito window AND a regular window
+ // because switching between regular and incognito windows is the only use
+ // case that works right now.
Peter Kasting 2012/08/24 22:19:32 Nit: Is there some sort of applicable "TODO: Expan
views::Button* switcher_button = browser_view_->window_switcher_button_;
if (switcher_button) {
- if (browser_view_->browser()->profile()->HasOffTheRecordProfile()) {
+ if (browser_view_->browser()->profile()->HasOffTheRecordProfile() &&
Peter Kasting 2012/08/24 22:19:32 Nit: Switch all "browser_view_->browser()" calls t
+ browser::FindBrowserWithProfile(
+ browser_view_->browser()->profile()->GetOriginalProfile(),
+ browser_view_->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