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

Unified Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_commands_unittest.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_to_mobile_service.cc
===================================================================
--- chrome/browser/chrome_to_mobile_service.cc (revision 144460)
+++ chrome/browser/chrome_to_mobile_service.cc (working copy)
@@ -21,6 +21,7 @@
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -331,6 +332,7 @@
// Track the set of temporary files to be deleted later.
snapshots_.insert(path);
+ // TODO(jam): This is bad and should be replaced with some sort of context.
Browser* browser = browser::FindLastActiveWithProfile(profile_);
if (success && browser && browser->GetActiveWebContents()) {
// Generate the snapshot and have the observer be called back on completion.
@@ -473,10 +475,12 @@
if (!mobiles_.empty())
LogMetric(DEVICES_AVAILABLE);
+ // TODO(jam): This is bad and should be replaced with some sort of context.
Browser* browser = browser::FindLastActiveWithProfile(profile_);
- if (browser && browser->command_updater())
- browser->command_updater()->UpdateCommandEnabled(
- IDC_CHROME_TO_MOBILE_PAGE, !mobiles_.empty());
+ if (browser) {
+ browser->command_controller()->SendToMobileStateChanged(
+ !mobiles_.empty());
+ }
}
}
« no previous file with comments | « chrome/browser/browser_commands_unittest.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698