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.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 290 |
291 BrowserView::BrowserView(Browser* browser) | 291 BrowserView::BrowserView(Browser* browser) |
292 : views::ClientView(NULL, NULL), | 292 : views::ClientView(NULL, NULL), |
293 last_focused_view_storage_id_( | 293 last_focused_view_storage_id_( |
294 views::ViewStorage::GetInstance()->CreateStorageID()), | 294 views::ViewStorage::GetInstance()->CreateStorageID()), |
295 frame_(NULL), | 295 frame_(NULL), |
296 browser_(browser), | 296 browser_(browser), |
297 active_bookmark_bar_(NULL), | 297 active_bookmark_bar_(NULL), |
298 tabstrip_(NULL), | 298 tabstrip_(NULL), |
299 toolbar_(NULL), | 299 toolbar_(NULL), |
| 300 window_switcher_button_(NULL), |
300 infobar_container_(NULL), | 301 infobar_container_(NULL), |
301 contents_container_(NULL), | 302 contents_container_(NULL), |
302 devtools_container_(NULL), | 303 devtools_container_(NULL), |
303 preview_container_(NULL), | 304 preview_container_(NULL), |
304 contents_(NULL), | 305 contents_(NULL), |
305 contents_split_(NULL), | 306 contents_split_(NULL), |
306 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), | 307 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), |
307 initialized_(false), | 308 initialized_(false), |
308 ignore_layout_(true), | 309 ignore_layout_(true), |
309 #if defined(OS_WIN) && !defined(USE_AURA) | 310 #if defined(OS_WIN) && !defined(USE_AURA) |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); | 792 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); |
792 } | 793 } |
793 } | 794 } |
794 | 795 |
795 void BrowserView::RestoreFocus() { | 796 void BrowserView::RestoreFocus() { |
796 WebContents* selected_web_contents = GetSelectedWebContents(); | 797 WebContents* selected_web_contents = GetSelectedWebContents(); |
797 if (selected_web_contents) | 798 if (selected_web_contents) |
798 selected_web_contents->GetView()->RestoreFocus(); | 799 selected_web_contents->GetView()->RestoreFocus(); |
799 } | 800 } |
800 | 801 |
| 802 void BrowserView::SetWindowSwitcherButton(views::Button* button) { |
| 803 if (window_switcher_button_) |
| 804 RemoveChildView(window_switcher_button_); |
| 805 window_switcher_button_ = button; |
| 806 AddChildView(button); |
| 807 } |
| 808 |
801 LocationBar* BrowserView::GetLocationBar() const { | 809 LocationBar* BrowserView::GetLocationBar() const { |
802 return GetLocationBarView(); | 810 return GetLocationBarView(); |
803 } | 811 } |
804 | 812 |
805 void BrowserView::SetFocusToLocationBar(bool select_all) { | 813 void BrowserView::SetFocusToLocationBar(bool select_all) { |
806 #if defined(OS_WIN) | 814 #if defined(OS_WIN) |
807 // On Windows changing focus to the location bar causes the browser window | 815 // On Windows changing focus to the location bar causes the browser window |
808 // to become active. This can steal focus if the user has another window | 816 // to become active. This can steal focus if the user has another window |
809 // open already. | 817 // open already. |
810 if (!force_location_bar_focus_ && !IsActive()) | 818 if (!force_location_bar_focus_ && !IsActive()) |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 return; | 2395 return; |
2388 | 2396 |
2389 PasswordGenerationBubbleView* bubble = | 2397 PasswordGenerationBubbleView* bubble = |
2390 new PasswordGenerationBubbleView(bounds, | 2398 new PasswordGenerationBubbleView(bounds, |
2391 this, | 2399 this, |
2392 web_contents->GetRenderViewHost()); | 2400 web_contents->GetRenderViewHost()); |
2393 views::BubbleDelegateView::CreateBubble(bubble); | 2401 views::BubbleDelegateView::CreateBubble(bubble); |
2394 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2402 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2395 bubble->Show(); | 2403 bubble->Show(); |
2396 } | 2404 } |
OLD | NEW |