| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 75 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
| 76 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 76 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
| 77 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 77 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 78 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 78 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 79 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 79 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 80 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 80 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 81 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 81 #include "chrome/browser/ui/views/password_generation_bubble_view.h" |
| 82 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" | 82 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
| 83 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 83 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
| 84 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 84 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 85 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" |
| 85 #include "chrome/browser/ui/views/status_bubble_views.h" | 86 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 86 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 87 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 87 #include "chrome/browser/ui/views/tabs/tab.h" | 88 #include "chrome/browser/ui/views/tabs/tab.h" |
| 88 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 89 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 89 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 90 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
| 90 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 91 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 91 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | 92 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
| 92 #include "chrome/browser/ui/views/update_recommended_message_box.h" | 93 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
| 93 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h" | 94 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h" |
| 94 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" | 95 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 // WebContents requires root window specific data - information about | 1433 // WebContents requires root window specific data - information about |
| 1433 // the screen the WebContents is drawn on, for example. | 1434 // the screen the WebContents is drawn on, for example. |
| 1434 if (!contents->GetView()->GetNativeView()->GetRootWindow()) { | 1435 if (!contents->GetView()->GetNativeView()->GetRootWindow()) { |
| 1435 aura::Window* window = contents->GetView()->GetNativeView(); | 1436 aura::Window* window = contents->GetView()->GetNativeView(); |
| 1436 aura::Window* root_window = GetNativeWindow()->GetRootWindow(); | 1437 aura::Window* root_window = GetNativeWindow()->GetRootWindow(); |
| 1437 aura::client::ParentWindowWithContext( | 1438 aura::client::ParentWindowWithContext( |
| 1438 window, root_window, root_window->GetBoundsInScreen()); | 1439 window, root_window, root_window->GetBoundsInScreen()); |
| 1439 DCHECK(contents->GetView()->GetNativeView()->GetRootWindow()); | 1440 DCHECK(contents->GetView()->GetNativeView()->GetRootWindow()); |
| 1440 } | 1441 } |
| 1441 web_contents_close_handler_->TabInserted(); | 1442 web_contents_close_handler_->TabInserted(); |
| 1443 |
| 1444 if (foreground) |
| 1445 extensions::MaybeShowExtensionControlledNewTabPage(browser(), contents); |
| 1442 } | 1446 } |
| 1443 | 1447 |
| 1444 void BrowserView::TabDetachedAt(WebContents* contents, int index) { | 1448 void BrowserView::TabDetachedAt(WebContents* contents, int index) { |
| 1445 if (PermissionBubbleManager::FromWebContents(contents)) | 1449 if (PermissionBubbleManager::FromWebContents(contents)) |
| 1446 PermissionBubbleManager::FromWebContents(contents)->SetView(NULL); | 1450 PermissionBubbleManager::FromWebContents(contents)->SetView(NULL); |
| 1447 | 1451 |
| 1448 // We use index here rather than comparing |contents| because by this time | 1452 // We use index here rather than comparing |contents| because by this time |
| 1449 // the model has already removed |contents| from its list, so | 1453 // the model has already removed |contents| from its list, so |
| 1450 // browser_->GetActiveWebContents() will return NULL or something else. | 1454 // browser_->GetActiveWebContents() will return NULL or something else. |
| 1451 if (index == browser_->tab_strip_model()->active_index()) { | 1455 if (index == browser_->tab_strip_model()->active_index()) { |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2539 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2543 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2540 gfx::Point icon_bottom( | 2544 gfx::Point icon_bottom( |
| 2541 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2545 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2542 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2546 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2543 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2547 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2544 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2548 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2545 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2549 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2546 } | 2550 } |
| 2547 return top_arrow_height; | 2551 return top_arrow_height; |
| 2548 } | 2552 } |
| OLD | NEW |