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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 10021029: Propagate OnNativeWidgetMove to delegate/observers, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use |move_loop_widget_| and GetAttachedBrowserView, etc. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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/tab_contents/tab_contents_container.h" 57 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
59 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" 58 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
60 #include "chrome/browser/ui/views/tabs/tab_strip_factory.h" 59 #include "chrome/browser/ui/views/tabs/tab_strip_factory.h"
61 #include "chrome/browser/ui/views/toolbar_view.h" 60 #include "chrome/browser/ui/views/toolbar_view.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 web_contents->GetRenderViewHost()->NotifyMoveOrResizeStarted(); 1643 web_contents->GetRenderViewHost()->NotifyMoveOrResizeStarted();
1646 } 1644 }
1647 1645
1648 void BrowserView::OnWidgetMove() { 1646 void BrowserView::OnWidgetMove() {
1649 if (!initialized_) { 1647 if (!initialized_) {
1650 // Creating the widget can trigger a move. Ignore it until we've initialized 1648 // Creating the widget can trigger a move. Ignore it until we've initialized
1651 // things. 1649 // things.
1652 return; 1650 return;
1653 } 1651 }
1654 1652
1655 if (move_observer_)
1656 move_observer_->OnWidgetMoved();
1657
1658 // Cancel any tabstrip animations, some of them may be invalidated by the 1653 // Cancel any tabstrip animations, some of them may be invalidated by the
1659 // window being repositioned. 1654 // window being repositioned.
1660 // Comment out for one cycle to see if this fixes dist tests. 1655 // Comment out for one cycle to see if this fixes dist tests.
1661 // tabstrip_->DestroyDragController(); 1656 // tabstrip_->DestroyDragController();
1662 1657
1663 // status_bubble_ may be NULL if this is invoked during construction. 1658 // status_bubble_ may be NULL if this is invoked during construction.
1664 if (status_bubble_.get()) 1659 if (status_bubble_.get())
1665 status_bubble_->Reposition(); 1660 status_bubble_->Reposition();
1666 1661
1667 browser::HideBookmarkBubbleView(); 1662 browser::HideBookmarkBubbleView();
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
2511 return; 2506 return;
2512 2507
2513 PasswordGenerationBubbleView* bubble = 2508 PasswordGenerationBubbleView* bubble =
2514 new PasswordGenerationBubbleView(bounds, 2509 new PasswordGenerationBubbleView(bounds,
2515 this, 2510 this,
2516 web_contents->GetRenderViewHost()); 2511 web_contents->GetRenderViewHost());
2517 views::BubbleDelegateView::CreateBubble(bubble); 2512 views::BubbleDelegateView::CreateBubble(bubble);
2518 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 2513 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
2519 bubble->Show(); 2514 bubble->Show();
2520 } 2515 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/browser_window_move_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698