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 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 if (page_action_decorations_[i]->IsVisible()) | 350 if (page_action_decorations_[i]->IsVisible()) |
351 ++result; | 351 ++result; |
352 } | 352 } |
353 return result; | 353 return result; |
354 } | 354 } |
355 | 355 |
356 WebContents* LocationBarViewMac::GetWebContents() const { | 356 WebContents* LocationBarViewMac::GetWebContents() const { |
357 return browser_->tab_strip_model()->GetActiveWebContents(); | 357 return browser_->tab_strip_model()->GetActiveWebContents(); |
358 } | 358 } |
359 | 359 |
360 gfx::Rect LocationBarViewMac::GetOmniboxBounds() const { | |
361 return gfx::Rect(NSRectToCGRect([field_ frame])); | |
362 } | |
363 | |
364 PageActionDecoration* LocationBarViewMac::GetPageActionDecoration( | 360 PageActionDecoration* LocationBarViewMac::GetPageActionDecoration( |
365 ExtensionAction* page_action) { | 361 ExtensionAction* page_action) { |
366 DCHECK(page_action); | 362 DCHECK(page_action); |
367 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { | 363 for (size_t i = 0; i < page_action_decorations_.size(); ++i) { |
368 if (page_action_decorations_[i]->page_action() == page_action) | 364 if (page_action_decorations_[i]->page_action() == page_action) |
369 return page_action_decorations_[i]; | 365 return page_action_decorations_[i]; |
370 } | 366 } |
371 // If |page_action| is the browser action of an extension, no element in | 367 // If |page_action| is the browser action of an extension, no element in |
372 // |page_action_decorations_| will match. | 368 // |page_action_decorations_| will match. |
373 NOTREACHED(); | 369 NOTREACHED(); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 WebContents* web_contents = GetWebContents(); | 713 WebContents* web_contents = GetWebContents(); |
718 if (!web_contents) | 714 if (!web_contents) |
719 return; | 715 return; |
720 | 716 |
721 zoom_decoration_->Update(ZoomController::FromWebContents(web_contents)); | 717 zoom_decoration_->Update(ZoomController::FromWebContents(web_contents)); |
722 } | 718 } |
723 | 719 |
724 void LocationBarViewMac::UpdateStarDecorationVisibility() { | 720 void LocationBarViewMac::UpdateStarDecorationVisibility() { |
725 star_decoration_->SetVisible(IsStarEnabled()); | 721 star_decoration_->SetVisible(IsStarEnabled()); |
726 } | 722 } |
OLD | NEW |