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

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

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 6 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
OLDNEW
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"
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/location.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
15 #include "base/profiler/scoped_tracker.h" 16 #include "base/profiler/scoped_tracker.h"
17 #include "base/single_thread_task_runner.h"
16 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/thread_task_runner_handle.h"
17 #include "chrome/app/chrome_command_ids.h" 20 #include "chrome/app/chrome_command_ids.h"
18 #include "chrome/app/chrome_dll_resource.h" 21 #include "chrome/app/chrome_dll_resource.h"
19 #include "chrome/browser/app_mode/app_mode_utils.h" 22 #include "chrome/browser/app_mode/app_mode_utils.h"
20 #include "chrome/browser/bookmarks/bookmark_stats.h" 23 #include "chrome/browser/bookmarks/bookmark_stats.h"
21 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
23 #include "chrome/browser/extensions/extension_util.h" 26 #include "chrome/browser/extensions/extension_util.h"
24 #include "chrome/browser/extensions/tab_helper.h" 27 #include "chrome/browser/extensions/tab_helper.h"
25 #include "chrome/browser/infobars/infobar_service.h" 28 #include "chrome/browser/infobars/infobar_service.h"
26 #include "chrome/browser/native_window_notification_source.h" 29 #include "chrome/browser/native_window_notification_source.h"
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 1629
1627 #if defined(USE_AURA) && defined(OS_CHROMEOS) 1630 #if defined(USE_AURA) && defined(OS_CHROMEOS)
1628 // On Aura window manager controls all windows so settings focus via PostTask 1631 // On Aura window manager controls all windows so settings focus via PostTask
1629 // will make only worse because posted task will keep trying to steal focus. 1632 // will make only worse because posted task will keep trying to steal focus.
1630 queue->ActivateModalDialog(); 1633 queue->ActivateModalDialog();
1631 #else 1634 #else
1632 // If another browser is app modal, flash and activate the modal browser. This 1635 // If another browser is app modal, flash and activate the modal browser. This
1633 // has to be done in a post task, otherwise if the user clicked on a window 1636 // has to be done in a post task, otherwise if the user clicked on a window
1634 // that doesn't have the modal dialog the windows keep trying to get the focus 1637 // that doesn't have the modal dialog the windows keep trying to get the focus
1635 // from each other on Windows. http://crbug.com/141650. 1638 // from each other on Windows. http://crbug.com/141650.
1636 base::MessageLoop::current()->PostTask( 1639 base::ThreadTaskRunnerHandle::Get()->PostTask(
1637 FROM_HERE, 1640 FROM_HERE, base::Bind(&BrowserView::ActivateAppModalDialog,
1638 base::Bind(&BrowserView::ActivateAppModalDialog, 1641 activate_modal_dialog_factory_.GetWeakPtr()));
1639 activate_modal_dialog_factory_.GetWeakPtr()));
1640 #endif 1642 #endif
1641 return false; 1643 return false;
1642 } 1644 }
1643 1645
1644 base::string16 BrowserView::GetWindowTitle() const { 1646 base::string16 BrowserView::GetWindowTitle() const {
1645 return browser_->GetWindowTitleForCurrentTab(); 1647 return browser_->GetWindowTitleForCurrentTab();
1646 } 1648 }
1647 1649
1648 base::string16 BrowserView::GetAccessibleWindowTitle() const { 1650 base::string16 BrowserView::GetAccessibleWindowTitle() const {
1649 if (IsOffTheRecord()) { 1651 if (IsOffTheRecord()) {
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 return immersive_mode_controller()->IsEnabled(); 2617 return immersive_mode_controller()->IsEnabled();
2616 } 2618 }
2617 2619
2618 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2620 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2619 return GetWidget(); 2621 return GetWidget();
2620 } 2622 }
2621 2623
2622 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2624 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2623 return top_container_->GetBoundsInScreen(); 2625 return top_container_->GetBoundsInScreen();
2624 } 2626 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698