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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 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 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 LocationBarViewMac::~LocationBarViewMac() { 140 LocationBarViewMac::~LocationBarViewMac() {
141 // Disconnect from cell in case it outlives us. 141 // Disconnect from cell in case it outlives us.
142 [[field_ cell] clearDecorations]; 142 [[field_ cell] clearDecorations];
143 } 143 }
144 144
145 void LocationBarViewMac::ShowFirstRunBubble() { 145 void LocationBarViewMac::ShowFirstRunBubble() {
146 // We need the browser window to be shown before we can show the bubble, but 146 // We need the browser window to be shown before we can show the bubble, but
147 // we get called before that's happened. 147 // we get called before that's happened.
148 MessageLoop::current()->PostTask(FROM_HERE, 148 base::MessageLoop::current()->PostTask(FROM_HERE,
149 base::Bind(&LocationBarViewMac::ShowFirstRunBubbleInternal, 149 base::Bind(&LocationBarViewMac::ShowFirstRunBubbleInternal,
150 weak_ptr_factory_.GetWeakPtr())); 150 weak_ptr_factory_.GetWeakPtr()));
151 } 151 }
152 152
153 void LocationBarViewMac::ShowFirstRunBubbleInternal() { 153 void LocationBarViewMac::ShowFirstRunBubbleInternal() {
154 if (!field_ || ![field_ window]) 154 if (!field_ || ![field_ window])
155 return; 155 return;
156 156
157 // The first run bubble's left edge should line up with the left edge of the 157 // The first run bubble's left edge should line up with the left edge of the
158 // omnibox. This is different from other bubbles, which line up at a point 158 // omnibox. This is different from other bubbles, which line up at a point
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 if (!toolbar_model_->GetInputInProgress() && 801 if (!toolbar_model_->GetInputInProgress() &&
802 toolbar_model_->GetSearchTermsType() != ToolbarModel::NO_SEARCH_TERMS) { 802 toolbar_model_->GetSearchTermsType() != ToolbarModel::NO_SEARCH_TERMS) {
803 const TemplateURL* template_url = 803 const TemplateURL* template_url =
804 TemplateURLServiceFactory::GetForProfile(profile_)-> 804 TemplateURLServiceFactory::GetForProfile(profile_)->
805 GetDefaultSearchProvider(); 805 GetDefaultSearchProvider();
806 if (template_url) 806 if (template_url)
807 return template_url->short_name(); 807 return template_url->short_name();
808 } 808 }
809 return string16(); 809 return string16();
810 } 810 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698