| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/cocoa/location_bar/location_bar_view_mac.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/nsimage_cache_mac.h" | 9 #include "base/nsimage_cache_mac.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return browser_->GetSelectedTabContents(); | 280 return browser_->GetSelectedTabContents(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 PageActionDecoration* LocationBarViewMac::GetPageActionDecoration( | 283 PageActionDecoration* LocationBarViewMac::GetPageActionDecoration( |
| 284 ExtensionAction* page_action) { | 284 ExtensionAction* page_action) { |
| 285 DCHECK(page_action); | 285 DCHECK(page_action); |
| 286 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { | 286 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { |
| 287 if (page_action_decorations_[i]->page_action() == page_action) | 287 if (page_action_decorations_[i]->page_action() == page_action) |
| 288 return page_action_decorations_[i]; | 288 return page_action_decorations_[i]; |
| 289 } | 289 } |
| 290 // If |page_action| is the browser action of an extension, no element in |
| 291 // |page_action_decorations_| will match. |
| 290 NOTREACHED(); | 292 NOTREACHED(); |
| 291 return NULL; | 293 return NULL; |
| 292 } | 294 } |
| 293 | 295 |
| 294 void LocationBarViewMac::SetPreviewEnabledPageAction( | 296 void LocationBarViewMac::SetPreviewEnabledPageAction( |
| 295 ExtensionAction* page_action, bool preview_enabled) { | 297 ExtensionAction* page_action, bool preview_enabled) { |
| 296 DCHECK(page_action); | 298 DCHECK(page_action); |
| 297 TabContents* contents = GetTabContents(); | 299 TabContents* contents = GetTabContents(); |
| 298 if (!contents) | 300 if (!contents) |
| 299 return; | 301 return; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 556 |
| 555 // These need to change anytime the layout changes. | 557 // These need to change anytime the layout changes. |
| 556 // TODO(shess): Anytime the field editor might have changed, the | 558 // TODO(shess): Anytime the field editor might have changed, the |
| 557 // cursor rects almost certainly should have changed. The tooltips | 559 // cursor rects almost certainly should have changed. The tooltips |
| 558 // might change even when the rects don't change. | 560 // might change even when the rects don't change. |
| 559 [field_ resetFieldEditorFrameIfNeeded]; | 561 [field_ resetFieldEditorFrameIfNeeded]; |
| 560 [field_ updateCursorAndToolTipRects]; | 562 [field_ updateCursorAndToolTipRects]; |
| 561 | 563 |
| 562 [field_ setNeedsDisplay:YES]; | 564 [field_ setNeedsDisplay:YES]; |
| 563 } | 565 } |
| OLD | NEW |