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

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Use new minimal sensor API Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 29 matching lines...) Expand all
40 #include "chrome/common/chrome_paths.h" 40 #include "chrome/common/chrome_paths.h"
41 #include "chrome/common/chrome_version_info.h" 41 #include "chrome/common/chrome_version_info.h"
42 #include "chrome/common/jstemplate_builder.h" 42 #include "chrome/common/jstemplate_builder.h"
43 #include "chrome/common/net/gaia/google_service_auth_error.h" 43 #include "chrome/common/net/gaia/google_service_auth_error.h"
44 #include "chrome/common/render_messages.h" 44 #include "chrome/common/render_messages.h"
45 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
46 #include "content/browser/browser_thread.h" 46 #include "content/browser/browser_thread.h"
47 #include "content/browser/gpu/gpu_process_host.h" 47 #include "content/browser/gpu/gpu_process_host.h"
48 #include "content/browser/renderer_host/render_process_host.h" 48 #include "content/browser/renderer_host/render_process_host.h"
49 #include "content/browser/renderer_host/render_view_host.h" 49 #include "content/browser/renderer_host/render_view_host.h"
50 #include "content/browser/sensors/provider.h"
50 #include "content/common/gpu/gpu_messages.h" 51 #include "content/common/gpu/gpu_messages.h"
51 #include "crypto/nss_util.h" 52 #include "crypto/nss_util.h"
52 #include "googleurl/src/gurl.h" 53 #include "googleurl/src/gurl.h"
53 #include "grit/browser_resources.h" 54 #include "grit/browser_resources.h"
54 #include "grit/chromium_strings.h" 55 #include "grit/chromium_strings.h"
55 #include "grit/generated_resources.h" 56 #include "grit/generated_resources.h"
56 #include "grit/locale_settings.h" 57 #include "grit/locale_settings.h"
57 #include "net/base/escape.h" 58 #include "net/base/escape.h"
58 #include "net/base/net_util.h" 59 #include "net/base/net_util.h"
59 #include "ui/base/l10n/l10n_util.h" 60 #include "ui/base/l10n/l10n_util.h"
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 CHECK(false); 1490 CHECK(false);
1490 } else if (host == chrome::kChromeUIGpuCleanHost) { 1491 } else if (host == chrome::kChromeUIGpuCleanHost) {
1491 GpuProcessHost::SendOnIO( 1492 GpuProcessHost::SendOnIO(
1492 0, content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, new GpuMsg_Clean()); 1493 0, content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, new GpuMsg_Clean());
1493 } else if (host == chrome::kChromeUIGpuCrashHost) { 1494 } else if (host == chrome::kChromeUIGpuCrashHost) {
1494 GpuProcessHost::SendOnIO( 1495 GpuProcessHost::SendOnIO(
1495 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH, new GpuMsg_Crash()); 1496 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH, new GpuMsg_Crash());
1496 } else if (host == chrome::kChromeUIGpuHangHost) { 1497 } else if (host == chrome::kChromeUIGpuHangHost) {
1497 GpuProcessHost::SendOnIO( 1498 GpuProcessHost::SendOnIO(
1498 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang()); 1499 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang());
1500 } else if (host == chrome::kChromeUIRotateHost) {
1501 sensors::ScreenOrientation change;
1502 std::string query(url->query());
1503 if (query == "left") {
1504 change.upward = sensors::ScreenOrientation::LEFT;
1505 } else if (query == "right") {
1506 change.upward = sensors::ScreenOrientation::RIGHT;
1507 } else if (query == "top") {
1508 change.upward = sensors::ScreenOrientation::TOP;
1509 } else if (query == "bottom") {
1510 change.upward = sensors::ScreenOrientation::BOTTOM;
1511 }
1512 sensors::Provider::GetInstance()->FireScreenOrientationChange(change);
1513 host = chrome::kChromeUIBlankHost;
1514 *url = GURL(chrome::kChromeUIBlankHost);
1499 } 1515 }
1500 1516
1501 // Initialize any potentially corresponding AboutSource handler. 1517 // Initialize any potentially corresponding AboutSource handler.
1502 InitializeAboutDataSource(host, profile); 1518 InitializeAboutDataSource(host, profile);
1503 return true; 1519 return true;
1504 } 1520 }
1505 1521
1506 bool HandleNonNavigationAboutURL(const GURL& url) { 1522 bool HandleNonNavigationAboutURL(const GURL& url) {
1507 // chrome://ipc/ is currently buggy, so we disable it for official builds. 1523 // chrome://ipc/ is currently buggy, so we disable it for official builds.
1508 #if !defined(OFFICIAL_BUILD) 1524 #if !defined(OFFICIAL_BUILD)
(...skipping 11 matching lines...) Expand all
1520 return false; 1536 return false;
1521 } 1537 }
1522 1538
1523 std::vector<std::string> ChromePaths() { 1539 std::vector<std::string> ChromePaths() {
1524 std::vector<std::string> paths; 1540 std::vector<std::string> paths;
1525 paths.reserve(arraysize(kChromePaths)); 1541 paths.reserve(arraysize(kChromePaths));
1526 for (size_t i = 0; i < arraysize(kChromePaths); i++) 1542 for (size_t i = 0; i < arraysize(kChromePaths); i++)
1527 paths.push_back(kChromePaths[i]); 1543 paths.push_back(kChromePaths[i]);
1528 return paths; 1544 return paths;
1529 } 1545 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698