| 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 #import "base/mac/mac_util.h" | 9 #import "base/mac/mac_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 | 608 |
| 609 void LocationBarViewMac::OnAddedToWindow() { | 609 void LocationBarViewMac::OnAddedToWindow() { |
| 610 UpdateColorsToMatchTheme(); | 610 UpdateColorsToMatchTheme(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 void LocationBarViewMac::OnThemeChanged() { | 613 void LocationBarViewMac::OnThemeChanged() { |
| 614 UpdateColorsToMatchTheme(); | 614 UpdateColorsToMatchTheme(); |
| 615 } | 615 } |
| 616 | 616 |
| 617 void LocationBarViewMac::OnChanged() { | 617 void LocationBarViewMac::OnChanged() { |
| 618 NSImage* image = nil; | 618 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 619 if (ui::MaterialDesignController::IsModeMaterial()) { | |
| 620 UpdateLocationIcon(); | |
| 621 } else { | |
| 622 const int resource_id = omnibox_view_->GetIcon(); | 619 const int resource_id = omnibox_view_->GetIcon(); |
| 623 image = OmniboxViewMac::ImageForResource(resource_id); | 620 NSImage* image = OmniboxViewMac::ImageForResource(resource_id); |
| 624 location_icon_decoration_->SetImage(image); | 621 location_icon_decoration_->SetImage(image); |
| 625 ev_bubble_decoration_->SetImage(image); | 622 ev_bubble_decoration_->SetImage(image); |
| 626 Layout(); | 623 Layout(); |
| 624 return; |
| 627 } | 625 } |
| 626 UpdateLocationIcon(); |
| 628 } | 627 } |
| 629 | 628 |
| 630 void LocationBarViewMac::OnSetFocus() { | 629 void LocationBarViewMac::OnSetFocus() { |
| 631 // Update the keyword and search hint states. | 630 // Update the keyword and search hint states. |
| 632 OnChanged(); | 631 OnChanged(); |
| 633 } | 632 } |
| 634 | 633 |
| 635 void LocationBarViewMac::ShowURL() { | 634 void LocationBarViewMac::ShowURL() { |
| 636 omnibox_view_->ShowURL(); | 635 omnibox_view_->ShowURL(); |
| 637 } | 636 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 return zoom_decoration_->UpdateIfNecessary( | 805 return zoom_decoration_->UpdateIfNecessary( |
| 807 ui_zoom::ZoomController::FromWebContents(web_contents), | 806 ui_zoom::ZoomController::FromWebContents(web_contents), |
| 808 default_zoom_changed, | 807 default_zoom_changed, |
| 809 in_dark_mode); | 808 in_dark_mode); |
| 810 } | 809 } |
| 811 | 810 |
| 812 void LocationBarViewMac::OnDefaultZoomLevelChanged() { | 811 void LocationBarViewMac::OnDefaultZoomLevelChanged() { |
| 813 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) | 812 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) |
| 814 OnDecorationsChanged(); | 813 OnDecorationsChanged(); |
| 815 } | 814 } |
| OLD | NEW |