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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #import "base/mac/mac_util.h" | 9 #import "base/mac/mac_util.h" |
10 #include "base/message_loop/message_loop.h" | |
11 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
13 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
16 #import "chrome/browser/app_controller_mac.h" | 16 #import "chrome/browser/app_controller_mac.h" |
17 #include "chrome/browser/command_updater.h" | 17 #include "chrome/browser/command_updater.h" |
18 #include "chrome/browser/defaults.h" | 18 #include "chrome/browser/defaults.h" |
19 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 19 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
20 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 20 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
21 #include "chrome/browser/extensions/extension_action.h" | 21 #include "chrome/browser/extensions/extension_action.h" |
22 #include "chrome/browser/extensions/location_bar_controller.h" | 22 #include "chrome/browser/extensions/location_bar_controller.h" |
23 #include "chrome/browser/extensions/tab_helper.h" | 23 #include "chrome/browser/extensions/tab_helper.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Disconnect from cell in case it outlives us. | 148 // Disconnect from cell in case it outlives us. |
149 [[field_ cell] clearDecorations]; | 149 [[field_ cell] clearDecorations]; |
150 | 150 |
151 zoom::ZoomEventManager::GetForBrowserContext(profile()) | 151 zoom::ZoomEventManager::GetForBrowserContext(profile()) |
152 ->RemoveZoomEventManagerObserver(this); | 152 ->RemoveZoomEventManagerObserver(this); |
153 } | 153 } |
154 | 154 |
155 void LocationBarViewMac::ShowFirstRunBubble() { | 155 void LocationBarViewMac::ShowFirstRunBubble() { |
156 // We need the browser window to be shown before we can show the bubble, but | 156 // We need the browser window to be shown before we can show the bubble, but |
157 // we get called before that's happened. | 157 // we get called before that's happened. |
158 base::MessageLoop::current()->PostTask( | 158 base::ThreadTaskRunnerHandle::Get()->PostTask( |
159 FROM_HERE, base::Bind(&LocationBarViewMac::ShowFirstRunBubbleInternal, | 159 FROM_HERE, base::Bind(&LocationBarViewMac::ShowFirstRunBubbleInternal, |
160 weak_ptr_factory_.GetWeakPtr())); | 160 weak_ptr_factory_.GetWeakPtr())); |
161 } | 161 } |
162 | 162 |
163 GURL LocationBarViewMac::GetDestinationURL() const { | 163 GURL LocationBarViewMac::GetDestinationURL() const { |
164 return destination_url(); | 164 return destination_url(); |
165 } | 165 } |
166 | 166 |
167 WindowOpenDisposition LocationBarViewMac::GetWindowOpenDisposition() const { | 167 WindowOpenDisposition LocationBarViewMac::GetWindowOpenDisposition() const { |
168 return disposition(); | 168 return disposition(); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 OnDecorationsChanged(); | 853 OnDecorationsChanged(); |
854 } | 854 } |
855 | 855 |
856 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { | 856 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { |
857 std::vector<LocationBarDecoration*> decorations = GetDecorations(); | 857 std::vector<LocationBarDecoration*> decorations = GetDecorations(); |
858 std::vector<NSView*> views; | 858 std::vector<NSView*> views; |
859 for (const auto& decoration : decorations) | 859 for (const auto& decoration : decorations) |
860 views.push_back(decoration->GetAccessibilityView()); | 860 views.push_back(decoration->GetAccessibilityView()); |
861 return views; | 861 return views; |
862 } | 862 } |
OLD | NEW |