OLD | NEW |
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 #import <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // asynchronous operation, so for a short period of time SSLStatus may have | 52 // asynchronous operation, so for a short period of time SSLStatus may have |
53 // non-null certificate and SECURITY_STYLE_UNKNOWN |security_style|. | 53 // non-null certificate and SECURITY_STYLE_UNKNOWN |security_style|. |
54 return SSLStatus.certificate && | 54 return SSLStatus.certificate && |
55 SSLStatus.security_style != web::SECURITY_STYLE_UNKNOWN; | 55 SSLStatus.security_style != web::SECURITY_STYLE_UNKNOWN; |
56 } | 56 } |
57 | 57 |
58 // Returns whether the |webState| is presenting an offline page. | 58 // Returns whether the |webState| is presenting an offline page. |
59 bool IsCurrentPageOffline(web::WebState* webState) { | 59 bool IsCurrentPageOffline(web::WebState* webState) { |
60 if (!webState) | 60 if (!webState) |
61 return false; | 61 return false; |
62 auto navigationManager = webState->GetNavigationManager(); | 62 auto* navigationManager = webState->GetNavigationManager(); |
63 auto visibleItem = navigationManager->GetVisibleItem(); | 63 auto* visibleItem = navigationManager->GetVisibleItem(); |
64 if (!visibleItem) | 64 if (!visibleItem) |
65 return false; | 65 return false; |
66 const GURL& url = visibleItem->GetURL(); | 66 const GURL& url = visibleItem->GetURL(); |
67 return url.SchemeIs(kChromeUIScheme) && url.host() == kChromeUIOfflineHost; | 67 return url.SchemeIs(kChromeUIScheme) && url.host() == kChromeUIOfflineHost; |
68 } | 68 } |
69 | 69 |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 // An ObjC bridge class to allow taps on the clear button to be sent to a C++ | 72 // An ObjC bridge class to allow taps on the clear button to be sent to a C++ |
73 // class. | 73 // class. |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 if (IsIPadIdiom()) | 319 if (IsIPadIdiom()) |
320 [field_ setRightView:nil]; | 320 [field_ setRightView:nil]; |
321 } else if ([field_ displayedText].empty() && | 321 } else if ([field_ displayedText].empty() && |
322 ![field_ isShowingQueryRefinementChip]) { | 322 ![field_ isShowingQueryRefinementChip]) { |
323 [field_ setRightView:nil]; | 323 [field_ setRightView:nil]; |
324 } else { | 324 } else { |
325 [field_ setRightView:clear_text_button_]; | 325 [field_ setRightView:clear_text_button_]; |
326 [clear_text_button_ setAlpha:1]; | 326 [clear_text_button_ setAlpha:1]; |
327 } | 327 } |
328 } | 328 } |
OLD | NEW |