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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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
Index: chrome/browser/browser_about_handler.cc
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 580559953cf18050adf450c563674bd8c01921be..137a4077212bb1a8affcc2b56bec46a07b469132 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/browser_about_handler.h"
#include <algorithm>
+#include <iostream>
#include <string>
#include <vector>
@@ -47,6 +48,7 @@
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/sensors/provider.h"
#include "content/common/gpu/gpu_messages.h"
#include "crypto/nss_util.h"
#include "googleurl/src/gurl.h"
@@ -1449,6 +1451,24 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
} else if (host == chrome::kChromeUIGpuHangHost) {
GpuProcessHost::SendOnIO(
0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang());
+ } else if (host == chrome::kChromeUIRotateHost) {
+ sensors::ScreenOrientationChange change;
+ std::string query(url->query());
+ if (query == "left") {
+ change.upward = sensors::ScreenOrientationChange::LEFT;
+ } else if (query == "right") {
+ change.upward = sensors::ScreenOrientationChange::RIGHT;
+ } else if (query == "top") {
+ change.upward = sensors::ScreenOrientationChange::TOP;
+ } else if (query == "bottom") {
+ change.upward = sensors::ScreenOrientationChange::BOTTOM;
+ }
+ std::string data(reinterpret_cast<const char*>(&change), sizeof(change));
+ sensors::Provider::GetInstance()->FireSensorChanged(
+ sensors::kScreenOrientationChannel, data);
+
+ host = chrome::kChromeUIBlankHost;
+ *url = GURL(chrome::kChromeUIBlankHost);
}
// Initialize any potentially corresponding AboutSource handler.
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/power_menu_button.h » ('j') | chrome/browser/chromeos/status/power_menu_button.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698