~abreu-alexandre/oxide/add-ua-to-downloadrequested

« back to all changes in this revision

Viewing changes to shared/browser/oxide_browser_platform_integration.cc

  • Committer: Olivier Tilloy
  • Date: 2014-11-14 15:01:46 UTC
  • mfrom: (860.1.6 applicationstatechanged)
  • Revision ID: olivier.tilloy@canonical.com-20141114150146-11h26hlr24wq35ap
Monitor application state changes, and update PowerSaveBlocker state accordingly
(remove the screen dim lock when the app goes into the background, and restore it when it comes to the foreground).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "base/logging.h"
21
21
 
 
22
#include "oxide_browser_platform_integration_observer.h"
 
23
 
22
24
namespace oxide {
23
25
 
24
26
namespace {
67
69
  return NULL;
68
70
}
69
71
 
 
72
BrowserPlatformIntegration::ApplicationState
 
73
BrowserPlatformIntegration::GetApplicationState() {
 
74
  return APPLICATION_STATE_ACTIVE;
 
75
}
 
76
 
 
77
void BrowserPlatformIntegration::AddObserver(
 
78
    BrowserPlatformIntegrationObserver* observer) {
 
79
  observers_.AddObserver(observer);
 
80
}
 
81
 
 
82
void BrowserPlatformIntegration::RemoveObserver(
 
83
    BrowserPlatformIntegrationObserver* observer) {
 
84
  observers_.RemoveObserver(observer);
 
85
}
 
86
 
 
87
void BrowserPlatformIntegration::NotifyApplicationStateChanged() {
 
88
  FOR_EACH_OBSERVER(BrowserPlatformIntegrationObserver,
 
89
                    observers_,
 
90
                    ApplicationStateChanged());
 
91
}
 
92
 
70
93
} // namespace oxide