Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Move chrome zoom constants into their own file.

BUG=107063
TEST=none
TBR=jam
Review URL: http://codereview.chromium.org/8951008

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@114611 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
  • Loading branch information...
commit 3a8c253cb471a77c4135a594a9d1b650d6352839 1 parent 7cb0f86
authored
9  chrome_page_zoom.cc
@@ -2,10 +2,12 @@
2 2
 // Use of this source code is governed by a BSD-style license that can be
3 3
 // found in the LICENSE file.
4 4
 
  5
+#include "chrome/browser/chrome_page_zoom.h"
  6
+
5 7
 #include <algorithm>
6 8
 #include <cmath>
7 9
 
8  
-#include "chrome/browser/chrome_page_zoom.h"
  10
+#include "chrome/browser/chrome_page_zoom_constants.h"
9 11
 #include "content/public/common/page_zoom.h"
10 12
 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
11 13
 
@@ -16,11 +18,6 @@ enum PageZoomValueType {
16 18
   PAGE_ZOOM_VALUE_TYPE_LEVEL,
17 19
 };
18 20
 
19  
-const double kPresetZoomFactors[] = { 0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1.0,
20  
-                                      1.1, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 4.0,
21  
-                                      5.0 };
22  
-const size_t kPresetZoomFactorsSize = arraysize(kPresetZoomFactors);
23  
-
24 21
 std::vector<double> PresetZoomValues(PageZoomValueType value_type,
25 22
                                      double custom_value) {
26 23
   // Generate a vector of zoom values from an array of known preset
6  chrome_page_zoom.h
@@ -10,12 +10,6 @@
10 10
 
11 11
 namespace chrome_page_zoom {
12 12
 
13  
-// Zoom factors supported by the browser.
14  
-extern const double kPresetZoomFactors[];
15  
-
16  
-// Size of |kPresetZoomFactors|.
17  
-extern const size_t kPresetZoomFactorsSize;
18  
-
19 13
 // Return a sorted vector of zoom factors. The vector will consist of preset
20 14
 // values along with a custom value (if the custom value is not already
21 15
 // represented.)
14  chrome_page_zoom_constants.cc
... ...
@@ -0,0 +1,14 @@
  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
  3
+// found in the LICENSE file.
  4
+
  5
+#include "chrome/browser/chrome_page_zoom_constants.h"
  6
+
  7
+namespace chrome_page_zoom {
  8
+
  9
+const double kPresetZoomFactors[] = { 0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1.0,
  10
+                                      1.1, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 4.0,
  11
+                                      5.0 };
  12
+const size_t kPresetZoomFactorsSize = arraysize(kPresetZoomFactors);
  13
+
  14
+}  // namespace chrome_page_zoom
21  chrome_page_zoom_constants.h
... ...
@@ -0,0 +1,21 @@
  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
  3
+// found in the LICENSE file.
  4
+
  5
+#ifndef CHROME_BROWSER_CHROME_PAGE_ZOOM_CONSTANTS_H_
  6
+#define CHROME_BROWSER_CHROME_PAGE_ZOOM_CONSTANTS_H_
  7
+#pragma once
  8
+
  9
+#include "base/basictypes.h"
  10
+
  11
+namespace chrome_page_zoom {
  12
+
  13
+// Zoom factors supported by the browser.
  14
+extern const double kPresetZoomFactors[];
  15
+
  16
+// Size of |kPresetZoomFactors|.
  17
+extern const size_t kPresetZoomFactorsSize;
  18
+
  19
+}  // namespace chrome_page_zoom
  20
+
  21
+#endif  // CHROME_BROWSER_CHROME_PAGE_ZOOM_CONSTANTS_H_

0 notes on commit 3a8c253

Please sign in to comment.
Something went wrong with that request. Please try again.