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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 1951033003: [Mac][Material Design] Fix SelectedKeywordDecoration tests for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add documentation. Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 short_name = TemplateURLServiceFactory::GetForProfile(profile())-> 452 short_name = TemplateURLServiceFactory::GetForProfile(profile())->
453 GetKeywordShortName(keyword, &is_extension_keyword); 453 GetKeywordShortName(keyword, &is_extension_keyword);
454 } 454 }
455 455
456 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint(); 456 const bool is_keyword_hint = omnibox_view_->model()->is_keyword_hint();
457 if (!keyword.empty() && !is_keyword_hint) { 457 if (!keyword.empty() && !is_keyword_hint) {
458 // Switch from location icon to keyword mode. 458 // Switch from location icon to keyword mode.
459 location_icon_decoration_->SetVisible(false); 459 location_icon_decoration_->SetVisible(false);
460 selected_keyword_decoration_->SetVisible(true); 460 selected_keyword_decoration_->SetVisible(true);
461 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword); 461 selected_keyword_decoration_->SetKeyword(short_name, is_extension_keyword);
462 // Note: the first time through this code path the
463 // |selected_keyword_decoration_| has no image set because under Material
464 // Design we need to set its color, which we cannot do until we know the
465 // theme (by being installed in a browser window).
462 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword)); 466 selected_keyword_decoration_->SetImage(GetKeywordImage(keyword));
463 } else if (ShouldShowEVBubble()) { 467 } else if (ShouldShowEVBubble()) {
464 // Switch from location icon to show the EV bubble instead. 468 // Switch from location icon to show the EV bubble instead.
465 location_icon_decoration_->SetVisible(false); 469 location_icon_decoration_->SetVisible(false);
466 ev_bubble_decoration_->SetVisible(true); 470 ev_bubble_decoration_->SetVisible(true);
467 471
468 base::string16 label(GetToolbarModel()->GetEVCertName()); 472 base::string16 label(GetToolbarModel()->GetEVCertName());
469 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label)); 473 ev_bubble_decoration_->SetFullLabel(base::SysUTF16ToNSString(label));
470 } else if (!keyword.empty() && is_keyword_hint) { 474 } else if (!keyword.empty() && is_keyword_hint) {
471 keyword_hint_decoration_->SetKeyword(short_name, 475 keyword_hint_decoration_->SetKeyword(short_name,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 return zoom_decoration_->UpdateIfNecessary( 809 return zoom_decoration_->UpdateIfNecessary(
806 ui_zoom::ZoomController::FromWebContents(web_contents), 810 ui_zoom::ZoomController::FromWebContents(web_contents),
807 default_zoom_changed, 811 default_zoom_changed,
808 in_dark_mode); 812 in_dark_mode);
809 } 813 }
810 814
811 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 815 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
812 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 816 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
813 OnDecorationsChanged(); 817 OnDecorationsChanged();
814 } 818 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698