| 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 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/ui/dialog_style.h" | 41 #include "chrome/browser/ui/dialog_style.h" |
| 42 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 42 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 43 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 43 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 44 #include "chrome/browser/ui/view_ids.h" | 44 #include "chrome/browser/ui/view_ids.h" |
| 45 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" | 45 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
| 46 #include "chrome/browser/ui/views/avatar_menu_button.h" | 46 #include "chrome/browser/ui/views/avatar_menu_button.h" |
| 47 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 47 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 48 #include "chrome/browser/ui/views/browser_dialogs.h" | 48 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 49 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 49 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
| 50 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 50 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 51 #include "chrome/browser/ui/views/frame/browser_window_move_observer.h" | |
| 52 #include "chrome/browser/ui/views/frame/contents_container.h" | 51 #include "chrome/browser/ui/views/frame/contents_container.h" |
| 53 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 52 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
| 54 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 53 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 55 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 54 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 56 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 55 #include "chrome/browser/ui/views/password_generation_bubble_view.h" |
| 57 #include "chrome/browser/ui/views/status_bubble_views.h" | 56 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 58 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 57 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 59 #include "chrome/browser/ui/views/tabs/tab_strip_factory.h" | 58 #include "chrome/browser/ui/views/tabs/tab_strip_factory.h" |
| 60 #include "chrome/browser/ui/views/toolbar_view.h" | 59 #include "chrome/browser/ui/views/toolbar_view.h" |
| 61 #include "chrome/browser/ui/views/update_recommended_message_box.h" | 60 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 contents_(NULL), | 346 contents_(NULL), |
| 348 contents_split_(NULL), | 347 contents_split_(NULL), |
| 349 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), | 348 devtools_dock_side_(DEVTOOLS_DOCK_SIDE_BOTTOM), |
| 350 initialized_(false), | 349 initialized_(false), |
| 351 ignore_layout_(true), | 350 ignore_layout_(true), |
| 352 #if defined(OS_WIN) && !defined(USE_AURA) | 351 #if defined(OS_WIN) && !defined(USE_AURA) |
| 353 hung_window_detector_(&hung_plugin_action_), | 352 hung_window_detector_(&hung_plugin_action_), |
| 354 ticker_(0), | 353 ticker_(0), |
| 355 #endif | 354 #endif |
| 356 force_location_bar_focus_(false), | 355 force_location_bar_focus_(false), |
| 357 move_observer_(NULL), | |
| 358 ALLOW_THIS_IN_INITIALIZER_LIST(color_change_listener_(this)) { | 356 ALLOW_THIS_IN_INITIALIZER_LIST(color_change_listener_(this)) { |
| 359 browser_->tabstrip_model()->AddObserver(this); | 357 browser_->tabstrip_model()->AddObserver(this); |
| 360 } | 358 } |
| 361 | 359 |
| 362 BrowserView::~BrowserView() { | 360 BrowserView::~BrowserView() { |
| 363 #if defined(USE_ASH) | 361 #if defined(USE_ASH) |
| 364 // Destroy LauncherUpdater early on as it listens to the TabstripModel, which | 362 // Destroy LauncherUpdater early on as it listens to the TabstripModel, which |
| 365 // is destroyed by the browser. | 363 // is destroyed by the browser. |
| 366 icon_updater_.reset(); | 364 icon_updater_.reset(); |
| 367 #endif | 365 #endif |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 web_contents->GetRenderViewHost()->NotifyMoveOrResizeStarted(); | 1645 web_contents->GetRenderViewHost()->NotifyMoveOrResizeStarted(); |
| 1648 } | 1646 } |
| 1649 | 1647 |
| 1650 void BrowserView::OnWidgetMove() { | 1648 void BrowserView::OnWidgetMove() { |
| 1651 if (!initialized_) { | 1649 if (!initialized_) { |
| 1652 // Creating the widget can trigger a move. Ignore it until we've initialized | 1650 // Creating the widget can trigger a move. Ignore it until we've initialized |
| 1653 // things. | 1651 // things. |
| 1654 return; | 1652 return; |
| 1655 } | 1653 } |
| 1656 | 1654 |
| 1657 if (move_observer_) | |
| 1658 move_observer_->OnWidgetMoved(); | |
| 1659 | |
| 1660 // Cancel any tabstrip animations, some of them may be invalidated by the | 1655 // Cancel any tabstrip animations, some of them may be invalidated by the |
| 1661 // window being repositioned. | 1656 // window being repositioned. |
| 1662 // Comment out for one cycle to see if this fixes dist tests. | 1657 // Comment out for one cycle to see if this fixes dist tests. |
| 1663 // tabstrip_->DestroyDragController(); | 1658 // tabstrip_->DestroyDragController(); |
| 1664 | 1659 |
| 1665 // status_bubble_ may be NULL if this is invoked during construction. | 1660 // status_bubble_ may be NULL if this is invoked during construction. |
| 1666 if (status_bubble_.get()) | 1661 if (status_bubble_.get()) |
| 1667 status_bubble_->Reposition(); | 1662 status_bubble_->Reposition(); |
| 1668 | 1663 |
| 1669 browser::HideBookmarkBubbleView(); | 1664 browser::HideBookmarkBubbleView(); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 return; | 2509 return; |
| 2515 | 2510 |
| 2516 PasswordGenerationBubbleView* bubble = | 2511 PasswordGenerationBubbleView* bubble = |
| 2517 new PasswordGenerationBubbleView(bounds, | 2512 new PasswordGenerationBubbleView(bounds, |
| 2518 this, | 2513 this, |
| 2519 web_contents->GetRenderViewHost()); | 2514 web_contents->GetRenderViewHost()); |
| 2520 views::BubbleDelegateView::CreateBubble(bubble); | 2515 views::BubbleDelegateView::CreateBubble(bubble); |
| 2521 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2516 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2522 bubble->Show(); | 2517 bubble->Show(); |
| 2523 } | 2518 } |
| OLD | NEW |