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

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

Issue 10876009: Re-reland Integrate invalidation API into ChromeToMobileService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 "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.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 content::PAGE_TRANSITION_TYPED | 113 content::PAGE_TRANSITION_TYPED |
114 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), 114 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)),
115 weak_ptr_factory_(this) { 115 weak_ptr_factory_(this) {
116 // Disable Chrome To Mobile for off-the-record and non-synced profiles, 116 // Disable Chrome To Mobile for off-the-record and non-synced profiles,
117 // or if the feature is disabled by a command line flag or chrome://flags. 117 // or if the feature is disabled by a command line flag or chrome://flags.
118 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && 118 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() &&
119 ChromeToMobileService::IsChromeToMobileEnabled()) { 119 ChromeToMobileService::IsChromeToMobileEnabled()) {
120 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this); 120 command_updater_->AddCommandObserver(IDC_CHROME_TO_MOBILE_PAGE, this);
121 chrome_to_mobile_decoration_.reset( 121 chrome_to_mobile_decoration_.reset(
122 new ChromeToMobileDecoration(profile, command_updater)); 122 new ChromeToMobileDecoration(profile, command_updater));
123 ChromeToMobileServiceFactory::GetForProfile(profile)-> 123 UpdateChromeToMobileEnabled();
124 RequestMobileListUpdate();
125 } 124 }
126 125
127 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) { 126 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) {
128 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_)); 127 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_));
129 } 128 }
130 129
131 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { 130 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) {
132 DCHECK_EQ(i, content_setting_decorations_.size()); 131 DCHECK_EQ(i, content_setting_decorations_.size());
133 ContentSettingsType type = static_cast<ContentSettingsType>(i); 132 ContentSettingsType type = static_cast<ContentSettingsType>(i);
134 content_setting_decorations_.push_back( 133 content_setting_decorations_.push_back(
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); 760 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled);
762 } 761 }
763 762
764 void LocationBarViewMac::UpdateZoomDecoration() { 763 void LocationBarViewMac::UpdateZoomDecoration() {
765 TabContents* tab_contents = GetTabContents(); 764 TabContents* tab_contents = GetTabContents();
766 if (!tab_contents) 765 if (!tab_contents)
767 return; 766 return;
768 767
769 zoom_decoration_->Update(tab_contents->zoom_controller()); 768 zoom_decoration_->Update(tab_contents->zoom_controller());
770 } 769 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698