OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_finder.h" | 7 #include "chrome/browser/ui/browser_finder.h" |
8 #include "chrome/browser/ui/find_bar/find_bar.h" | 8 #include "chrome/browser/ui/find_bar/find_bar.h" |
9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
10 #include "chrome/browser/ui/search/search_model.h" | 10 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 int bottom = tabstrip_bounds.bottom(); | 338 int bottom = tabstrip_bounds.bottom(); |
339 | 339 |
340 // The metro window switcher sits at the far right edge of the tabstrip | 340 // The metro window switcher sits at the far right edge of the tabstrip |
341 // a |kWindowSwitcherOffsetX| pixels from the right edge. | 341 // a |kWindowSwitcherOffsetX| pixels from the right edge. |
342 // Only visible if there is more than one type of window to switch between. | 342 // Only visible if there is more than one type of window to switch between. |
343 // TODO(mad): update this code when more window types than just incognito | 343 // TODO(mad): update this code when more window types than just incognito |
344 // and regular are available. | 344 // and regular are available. |
345 views::Button* switcher_button = browser_view_->window_switcher_button_; | 345 views::Button* switcher_button = browser_view_->window_switcher_button_; |
346 if (switcher_button) { | 346 if (switcher_button) { |
347 if (browser()->profile()->HasOffTheRecordProfile() && | 347 if (browser()->profile()->HasOffTheRecordProfile() && |
348 browser::FindBrowserWithProfile( | 348 chrome::FindBrowserWithProfile( |
349 browser()->profile()->GetOriginalProfile(), | 349 browser()->profile()->GetOriginalProfile(), |
350 browser()->host_desktop_type()) != NULL) { | 350 browser()->host_desktop_type()) != NULL) { |
351 switcher_button->SetVisible(true); | 351 switcher_button->SetVisible(true); |
352 int width = browser_view_->width(); | 352 int width = browser_view_->width(); |
353 gfx::Size ps = switcher_button->GetPreferredSize(); | 353 gfx::Size ps = switcher_button->GetPreferredSize(); |
354 if (width > ps.width()) { | 354 if (width > ps.width()) { |
355 switcher_button->SetBounds(width - ps.width() - kWindowSwitcherOffsetX, | 355 switcher_button->SetBounds(width - ps.width() - kWindowSwitcherOffsetX, |
356 0, | 356 0, |
357 ps.width(), | 357 ps.width(), |
358 ps.height()); | 358 ps.height()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 } | 542 } |
543 return bottom; | 543 return bottom; |
544 } | 544 } |
545 | 545 |
546 bool BrowserViewLayout::InfobarVisible() const { | 546 bool BrowserViewLayout::InfobarVisible() const { |
547 views::View* infobar_container = browser_view_->infobar_container_; | 547 views::View* infobar_container = browser_view_->infobar_container_; |
548 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. | 548 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. |
549 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && | 549 return browser()->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && |
550 (infobar_container->GetPreferredSize().height() != 0); | 550 (infobar_container->GetPreferredSize().height() != 0); |
551 } | 551 } |
OLD | NEW |