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

Side by Side Diff: ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.mm

Issue 2808873002: [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. (Closed)
Patch Set: feedback Created 3 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
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 "ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.h" 5 #include "ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.h"
6 6
7 #include "components/bookmarks/browser/bookmark_model.h" 7 #include "components/bookmarks/browser/bookmark_model.h"
8 #include "components/toolbar/toolbar_model_impl.h" 8 #include "components/toolbar/toolbar_model_impl.h"
9 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" 9 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
11 #include "ios/chrome/browser/chrome_url_constants.h" 11 #include "ios/chrome/browser/chrome_url_constants.h"
12 #import "ios/chrome/browser/tabs/legacy_tab_helper.h" 12 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
13 #include "ios/chrome/browser/tabs/tab.h" 13 #include "ios/chrome/browser/tabs/tab.h"
14 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h" 14 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h"
15 #import "ios/web/public/web_state/web_state.h" 15 #import "ios/web/public/web_state/web_state.h"
16 #import "ios/web/web_state/ui/crw_web_controller.h"
17
18 #if !defined(__has_feature) || !__has_feature(objc_arc)
19 #error "This file requires ARC support."
20 #endif
16 21
17 namespace { 22 namespace {
18 const size_t kMaxURLDisplayChars = 32 * 1024; 23 const size_t kMaxURLDisplayChars = 32 * 1024;
19 24
20 bookmarks::BookmarkModel* GetBookmarkModelForWebState( 25 bookmarks::BookmarkModel* GetBookmarkModelForWebState(
21 web::WebState* web_state) { 26 web::WebState* web_state) {
22 if (!web_state) 27 if (!web_state)
23 return nullptr; 28 return nullptr;
24 web::BrowserState* browser_state = web_state->GetBrowserState(); 29 web::BrowserState* browser_state = web_state->GetBrowserState();
25 if (!browser_state) 30 if (!browser_state)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 95 }
91 96
92 bool ToolbarModelImplIOS::ShouldDisplayHintText() { 97 bool ToolbarModelImplIOS::ShouldDisplayHintText() {
93 web::WebState* web_state = delegate_->GetActiveWebState(); 98 web::WebState* web_state = delegate_->GetActiveWebState();
94 if (!web_state) 99 if (!web_state)
95 return false; 100 return false;
96 101
97 Tab* tab = LegacyTabHelper::GetTabForWebState(web_state); 102 Tab* tab = LegacyTabHelper::GetTabForWebState(web_state);
98 return tab && [tab.webController wantsLocationBarHintText]; 103 return tab && [tab.webController wantsLocationBarHintText];
99 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698