summaryrefslogtreecommitdiff
path: root/inputmethod/fcitx5-mozc/patches/patch-2.26.4282.100
blob: 094db41b80078be1c0537a677b47aa009899dd91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
$NetBSD: patch-2.26.4282.100,v 1.1 2021/02/17 15:29:51 ryoon Exp $

* Update to 2.26.4282.100

diff --git android/gen_mozc_drawable.py android/gen_mozc_drawable.py
index 92e58828a..3b8fc46c1 100644
--- android/gen_mozc_drawable.py
+++ android/gen_mozc_drawable.py
@@ -353,7 +353,7 @@ def _ParseStyle(self, node, has_shadow, shader_map):
     stroke_map = {'style': 'stroke', 'shadow': has_shadow}
 
     # Special warning for font-size.
-    # Inkscape often unexpectedly converts from sytle to font-size attribute.
+    # Inkscape often unexpectedly converts from style to font-size attribute.
     if node.get('font-size', ''):
       logging.warning('font-size attribute is not supported.')
 
diff --git android/gen_touch_event_stats.py android/gen_touch_event_stats.py
index 2a28ba15d..f38f9b03a 100644
--- android/gen_touch_event_stats.py
+++ android/gen_touch_event_stats.py
@@ -112,7 +112,7 @@ def GetAverage(source_value, stats_type):
       return 0
     # Cumulative average values are multiplied by 10^7
     # when usage stats are sent to the log server.
-    # Here we get original value by dividing the avarage value.
+    # Here we get original value by dividing the average value.
     return cumulative_average / 1e7 / count
 
   # c.f. usage_stats/usage_stats_uploader.cc
diff --git base/BUILD base/BUILD
index 83f5740e4..6dca976f7 100644
--- base/BUILD
+++ base/BUILD
@@ -60,7 +60,6 @@ test_suite(
         ":config_file_stream_test_android",
         ":cpu_stats_test_android",
         ":encryptor_test_android",
-        ":flags_test_android",
         ":hash_test_android",
         ":iterator_adapter_test_android",
         ":logging_test_android",
@@ -101,7 +100,6 @@ cc_library_mozc(
         ":const",
         ":file_stream",
         ":file_util",
-        ":flags",
         ":mmap",
         ":mutex",
         ":number_util",
@@ -122,25 +120,10 @@ cc_library_mozc(
 
 cc_library_mozc(
     name = "flags",
-    srcs = ["flags.cc"],
     hdrs = ["flags.h"],
     deps = [
         ":port",
         "@com_google_absl//absl/flags:flag",
-    ] + select_mozc(
-        client = [":singleton"],
-        default = ["//base"],
-    ),
-)
-
-cc_test_mozc(
-    name = "flags_test",
-    size = "small",
-    srcs = ["flags_test.cc"],
-    requires_full_emulation = False,
-    deps = [
-        ":flags",
-        "//testing:gunit_main",
     ],
 )
 
@@ -150,16 +133,15 @@ cc_library_mozc(
     hdrs = ["init_mozc.h"],
     copts = ["-DMOZC_BUILDTOOL_BUILD"],
     visibility = ["//:__subpackages__"],
-    deps = select_mozc(
+    deps = [
+        "@com_google_absl//absl/flags:flag",
+    ] + select_mozc(
         client = [
             ":file_util",
-            ":flags",
             ":logging",
+            "@com_google_absl//absl/flags:parse",
         ],
-        default = [
-            "//base",
-            ":flags",
-        ],
+        default = ["//base"],
     ),
 )
 
@@ -168,17 +150,16 @@ cc_library_mozc(
     srcs = ["init_mozc.cc"],
     hdrs = ["init_mozc.h"],
     visibility = ["//:__subpackages__"],
-    deps = select_mozc(
+    deps = [
+        "@com_google_absl//absl/flags:flag",
+    ] + select_mozc(
         client = [
             ":file_util",
-            ":flags",
             ":logging",
             ":system_util",
+            "@com_google_absl//absl/flags:parse",
         ],
-        default = [
-            "//base",
-            ":flags",
-        ],
+        default = ["//base"],
     ),
 )
 
@@ -227,7 +208,6 @@ cc_library_mozc(
         client = [
             ":clock",
             ":const",
-            ":flags",
             ":mutex",
             ":singleton",
             "@com_google_absl//absl/strings",
@@ -236,7 +216,10 @@ cc_library_mozc(
             "//base",
             "//base:logging_extensions",
         ],
-    ) + [":port"],
+    ) + [
+        ":port",
+        "@com_google_absl//absl/flags:flag",
+    ],
 )
 
 cc_test_mozc(
@@ -576,10 +559,10 @@ cc_binary_mozc(
     deps = [
         ":double_array_def",
         ":file_stream",
-        ":flags",
         ":init_mozc_buildtool",
         ":logging",
         ":util",
+        "@com_google_absl//absl/flags:flag",
         "//third_party/darts/v0_32",
     ],
 )
@@ -733,10 +716,10 @@ cc_test_mozc(
     deps = [
         ":file_stream",
         ":file_util",
-        ":flags",
         ":mmap",
         ":util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -800,11 +783,11 @@ cc_test_mozc(
     deps = [
         ":file_stream",
         ":file_util",
-        ":flags",
         ":logging",
         ":number_util",
         ":util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -893,10 +876,10 @@ cc_binary_mozc(
     name = "process_main",
     srcs = ["process_main.cc"],
     deps = [
-        ":flags",
         ":init_mozc",
         ":logging",
         ":process",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -925,11 +908,11 @@ cc_test_mozc(
     deps = [
         "logging",
         ":file_util",
-        ":flags",
         ":process_mutex",
         ":system_util",
         ":util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -956,9 +939,9 @@ cc_binary_mozc(
     name = "run_level_main",
     srcs = ["run_level_main.cc"],
     deps = [
-        ":flags",
         ":init_mozc",
         ":run_level",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1016,9 +999,9 @@ cc_test_mozc(
     deps = [
         ":config_file_stream",
         ":file_util",
-        ":flags",
         ":system_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1169,10 +1152,10 @@ cc_test_mozc(
     visibility = ["//visibility:private"],
     deps = [
         ":encryptor",
-        ":flags",
         ":system_util",
         ":util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1183,11 +1166,11 @@ cc_binary_mozc(
     deps = [
         ":encryptor",
         ":file_stream",
-        ":flags",
         ":init_mozc",
         ":logging",
         ":mmap",
         ":util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -1198,10 +1181,10 @@ cc_binary_mozc(
     visibility = ["//visibility:private"],
     deps = [
         ":encryptor",
-        ":flags",
         ":init_mozc",
         ":logging",
         ":util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1288,11 +1271,11 @@ cc_binary_mozc(
     srcs = ["cpu_stats_main.cc"],
     deps = [
         ":cpu_stats",
-        ":flags",
         ":init_mozc",
         ":port",
         ":thread",
         ":util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -1326,10 +1309,10 @@ cc_binary_mozc(
     name = "stopwatch_main",
     srcs = ["stopwatch_main.cc"],
     deps = [
-        ":flags",
         ":init_mozc",
         ":stopwatch",
         ":util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1381,10 +1364,10 @@ cc_test_mozc(
     deps = [
         ":file_stream",
         ":file_util",
-        ":flags",
         ":multifile",
         ":util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1439,8 +1422,9 @@ cc_binary_mozc(
     ],
     deps = [
         ":init_mozc",
-        ":flags",
+        ":port",
         ":util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ] + select_mozc(ios = [":mac_util"]),
 )
@@ -1545,7 +1529,6 @@ cc_library_mozc(
         ],
         oss = [
             ":logging",
-            ":flags",
         ],
     ),
 )
diff --git base/base.gyp base/base.gyp
index 50446616f..0b87c4817 100644
--- base/base.gyp
+++ base/base.gyp
@@ -188,11 +188,8 @@
       'target_name': 'flags',
       'type': 'static_library',
       'toolsets': ['host', 'target'],
-      'sources': [
-        'flags.cc',
-      ],
       'dependencies': [
-        'singleton',
+        'absl.gyp:absl_flags',
       ],
     },
     {
diff --git base/base_test.gyp base/base_test.gyp
index d252fe60a..09a4cb2fa 100644
--- base/base_test.gyp
+++ base/base_test.gyp
@@ -101,7 +101,6 @@
       'type': 'executable',
       'sources': [
         'bitarray_test.cc',
-        'flags_test.cc',
         'iterator_adapter_test.cc',
         'logging_test.cc',
         'mmap_test.cc',
diff --git base/config_file_stream.h base/config_file_stream.h
index 17ddcf15d..7a09f850e 100644
--- base/config_file_stream.h
+++ base/config_file_stream.h
@@ -74,7 +74,7 @@ class ConfigFileStream {
   //     return Open(filename, ios_base::in);
   //   }
   // As of Mozc 1.3, a number of files had had depended on this method.
-  // However, we did not programatically replaced all of them with
+  // However, we did not programmatically replaced all of them with
   // |OpenReadText| because these existing code do not have enough unit
   // tests to check the treatment of line-end character, especially on Windows.
   // Perhaps |OpenReadBinary| might be more appropriate in some cases.
diff --git base/config_file_stream_test.cc base/config_file_stream_test.cc
index 6040f604f..29875f055 100644
--- base/config_file_stream_test.cc
+++ base/config_file_stream_test.cc
@@ -35,10 +35,10 @@
 #include <memory>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
@@ -61,7 +61,7 @@ std::string GetFileData(const std::string &filename) {
 // |input_stream| as a side effect.
 bool IsEof(std::istream *input_stream) {
   return (input_stream->peek() == std::istream::traits_type::eof() &&
-          // On some enviroment (e.g. Mac OS 10.8 w/ Xcode 4.5),
+          // On some environment (e.g. Mac OS 10.8 w/ Xcode 4.5),
           // peek() does not flip eofbit.  So calling get() is also
           // required.
           input_stream->get() == std::istream::traits_type::eof() &&
@@ -74,7 +74,7 @@ class ConfigFileStreamTest : public testing::Test {
  protected:
   void SetUp() override {
     default_profile_directory_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   void TearDown() override {
diff --git base/cpu_stats_main.cc base/cpu_stats_main.cc
index d70e0f75c..b318d00d3 100644
--- base/cpu_stats_main.cc
+++ base/cpu_stats_main.cc
@@ -32,16 +32,16 @@
 #include <string>
 
 #include "base/cpu_stats.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/port.h"
 #include "base/thread.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
-MOZC_FLAG(int32, iterations, 1000, "number of iterations");
-MOZC_FLAG(int32, polling_duration, 1000, "duration period in msec");
-MOZC_FLAG(int32, dummy_threads_size, 0, "number of dummy threads");
+ABSL_FLAG(int32, iterations, 1000, "number of iterations");
+ABSL_FLAG(int32, polling_duration, 1000, "duration period in msec");
+ABSL_FLAG(int32, dummy_threads_size, 0, "number of dummy threads");
 
 namespace {
 class DummyThread : public mozc::Thread {
@@ -65,10 +65,10 @@ int main(int argc, char **argv) {
 
   std::unique_ptr<DummyThread[]> threads;
 
-  if (mozc::GetFlag(FLAGS_dummy_threads_size) > 0) {
+  if (absl::GetFlag(FLAGS_dummy_threads_size) > 0) {
     threads = absl::make_unique<DummyThread[]>(
-        mozc::GetFlag(FLAGS_dummy_threads_size));
-    for (int i = 0; i < mozc::GetFlag(FLAGS_dummy_threads_size); ++i) {
+        absl::GetFlag(FLAGS_dummy_threads_size));
+    for (int i = 0; i < absl::GetFlag(FLAGS_dummy_threads_size); ++i) {
       threads[i].Start("CpuStatsMain");
     }
   }
@@ -76,10 +76,10 @@ int main(int argc, char **argv) {
   mozc::CPUStats stats;
   std::cout << "NumberOfProcessors: " << stats.GetNumberOfProcessors()
             << std::endl;
-  for (int i = 0; i < mozc::GetFlag(FLAGS_iterations); ++i) {
+  for (int i = 0; i < absl::GetFlag(FLAGS_iterations); ++i) {
     std::cout << "CPUStats: " << stats.GetSystemCPULoad() << " "
               << stats.GetCurrentProcessCPULoad() << std::endl;
-    mozc::Util::Sleep(mozc::GetFlag(FLAGS_polling_duration));
+    mozc::Util::Sleep(absl::GetFlag(FLAGS_polling_duration));
   }
 
   return 0;
diff --git base/encryptor_main.cc base/encryptor_main.cc
index 04790502c..4714fcf30 100644
--- base/encryptor_main.cc
+++ base/encryptor_main.cc
@@ -32,26 +32,26 @@
 
 #include "base/encryptor.h"
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/mmap.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, password, "", "password");
-MOZC_FLAG(string, salt, "", "salt");
-MOZC_FLAG(string, iv, "", "initialization vector");
+ABSL_FLAG(std::string, password, "", "password");
+ABSL_FLAG(std::string, salt, "", "salt");
+ABSL_FLAG(std::string, iv, "", "initialization vector");
 
-MOZC_FLAG(bool, encrypt, false, "encrypt mode");
-MOZC_FLAG(bool, decrypt, false, "decrypt mode");
+ABSL_FLAG(bool, encrypt, false, "encrypt mode");
+ABSL_FLAG(bool, decrypt, false, "decrypt mode");
 
 // encrypt/decrypt files
-MOZC_FLAG(string, input_file, "", "input file");
-MOZC_FLAG(string, output_file, "", "input file");
+ABSL_FLAG(std::string, input_file, "", "input file");
+ABSL_FLAG(std::string, output_file, "", "input file");
 
 // perform encryption/decryption with test_input.
 // used for making a golden data for unittesting
-MOZC_FLAG(string, test_input, "", "test input string");
+ABSL_FLAG(std::string, test_input, "", "test input string");
 
 namespace {
 std::string Escape(const std::string &buf) {
@@ -64,48 +64,48 @@ std::string Escape(const std::string &buf) {
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (!mozc::GetFlag(FLAGS_iv).empty()) {
-    CHECK_EQ(16, mozc::GetFlag(FLAGS_iv).size()) << "iv size must be 16 byte";
+  if (!absl::GetFlag(FLAGS_iv).empty()) {
+    CHECK_EQ(16, absl::GetFlag(FLAGS_iv).size()) << "iv size must be 16 byte";
   }
 
-  const std::string iv_str = mozc::GetFlag(FLAGS_iv);
+  const std::string iv_str = absl::GetFlag(FLAGS_iv);
   const uint8 *iv =
       iv_str.empty() ? nullptr : reinterpret_cast<const uint8 *>(iv_str.data());
 
-  if (!mozc::GetFlag(FLAGS_input_file).empty() &&
-      !mozc::GetFlag(FLAGS_output_file).empty()) {
+  if (!absl::GetFlag(FLAGS_input_file).empty() &&
+      !absl::GetFlag(FLAGS_output_file).empty()) {
     mozc::Encryptor::Key key;
-    CHECK(key.DeriveFromPassword(mozc::GetFlag(FLAGS_password),
-                                 mozc::GetFlag(FLAGS_salt), iv));
+    CHECK(key.DeriveFromPassword(absl::GetFlag(FLAGS_password),
+                                 absl::GetFlag(FLAGS_salt), iv));
 
     mozc::Mmap mmap;
-    CHECK(mmap.Open(mozc::GetFlag(FLAGS_input_file).c_str(), "r"));
+    CHECK(mmap.Open(absl::GetFlag(FLAGS_input_file).c_str(), "r"));
     std::string buf(mmap.begin(), mmap.size());
-    if (mozc::GetFlag(FLAGS_encrypt)) {
+    if (absl::GetFlag(FLAGS_encrypt)) {
       CHECK(mozc::Encryptor::EncryptString(key, &buf));
-    } else if (mozc::GetFlag(FLAGS_decrypt)) {
+    } else if (absl::GetFlag(FLAGS_decrypt)) {
       CHECK(mozc::Encryptor::DecryptString(key, &buf));
     } else {
       LOG(FATAL) << "unknown mode. set --encrypt or --decrypt";
     }
-    mozc::OutputFileStream ofs(mozc::GetFlag(FLAGS_output_file).c_str(),
+    mozc::OutputFileStream ofs(absl::GetFlag(FLAGS_output_file).c_str(),
                                std::ios::binary);
     CHECK(ofs);
     ofs.write(buf.data(), buf.size());
-  } else if (!mozc::GetFlag(FLAGS_test_input).empty()) {
+  } else if (!absl::GetFlag(FLAGS_test_input).empty()) {
     mozc::Encryptor::Key key1, key2;
-    CHECK(key1.DeriveFromPassword(mozc::GetFlag(FLAGS_password),
-                                  mozc::GetFlag(FLAGS_salt), iv));
-    CHECK(key2.DeriveFromPassword(mozc::GetFlag(FLAGS_password),
-                                  mozc::GetFlag(FLAGS_salt), iv));
+    CHECK(key1.DeriveFromPassword(absl::GetFlag(FLAGS_password),
+                                  absl::GetFlag(FLAGS_salt), iv));
+    CHECK(key2.DeriveFromPassword(absl::GetFlag(FLAGS_password),
+                                  absl::GetFlag(FLAGS_salt), iv));
 
-    std::string buf = mozc::GetFlag(FLAGS_test_input);
+    std::string buf = absl::GetFlag(FLAGS_test_input);
     std::string iv_buf(reinterpret_cast<const char *>(key1.iv()),
                        key1.iv_size());
 
-    std::cout << "Password:  \"" << Escape(mozc::GetFlag(FLAGS_password))
+    std::cout << "Password:  \"" << Escape(absl::GetFlag(FLAGS_password))
               << "\"" << std::endl;
-    std::cout << "Salt:      \"" << Escape(mozc::GetFlag(FLAGS_salt)) << "\""
+    std::cout << "Salt:      \"" << Escape(absl::GetFlag(FLAGS_salt)) << "\""
               << std::endl;
     std::cout << "IV:        \"" << Escape(iv_buf) << "\"" << std::endl;
     std::cout << "Input:     \"" << Escape(buf) << "\"" << std::endl;
diff --git base/encryptor_test.cc base/encryptor_test.cc
index d992ea901..9f9553a4e 100644
--- base/encryptor_test.cc
+++ base/encryptor_test.cc
@@ -31,12 +31,12 @@
 
 #include <memory>
 
-#include "base/flags.h"
 #include "base/password_manager.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
@@ -226,7 +226,7 @@ TEST(EncryptorTest, EncryptBatch) {
 }
 
 TEST(EncryptorTest, ProtectData) {
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   const size_t kSizeTable[] = {1, 10, 100, 1000, 10000, 100000};
 
   for (size_t i = 0; i < arraysize(kSizeTable); ++i) {
diff --git base/file_util_test.cc base/file_util_test.cc
index 1a11e2c5c..7251d2821 100644
--- base/file_util_test.cc
+++ base/file_util_test.cc
@@ -37,11 +37,11 @@
 #include <string>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 // Ad-hoc workadound against macro problem on Windows.
 // On Windows, following macros, defined when you include <Windows.h>,
@@ -71,10 +71,10 @@ void CreateTestFile(const std::string &filename, const std::string &data) {
 }  // namespace
 
 TEST_F(FileUtilTest, CreateDirectory) {
-  EXPECT_TRUE(FileUtil::DirectoryExists(mozc::GetFlag(FLAGS_test_tmpdir)));
+  EXPECT_TRUE(FileUtil::DirectoryExists(absl::GetFlag(FLAGS_test_tmpdir)));
   // dirpath = FLAGS_test_tmpdir/testdir
   const std::string dirpath =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testdir");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testdir");
 
   // Delete dirpath, if it exists.
   if (FileUtil::FileExists(dirpath)) {
@@ -92,9 +92,9 @@ TEST_F(FileUtilTest, CreateDirectory) {
 }
 
 TEST_F(FileUtilTest, DirectoryExists) {
-  EXPECT_TRUE(FileUtil::DirectoryExists(mozc::GetFlag(FLAGS_test_tmpdir)));
+  EXPECT_TRUE(FileUtil::DirectoryExists(absl::GetFlag(FLAGS_test_tmpdir)));
   const std::string filepath =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testfile");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testfile");
 
   // Delete filepath, if it exists.
   if (FileUtil::FileExists(filepath)) {
@@ -114,7 +114,7 @@ TEST_F(FileUtilTest, DirectoryExists) {
 
 TEST_F(FileUtilTest, Unlink) {
   const std::string filepath =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testfile");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testfile");
   FileUtil::Unlink(filepath);
   EXPECT_FALSE(FileUtil::FileExists(filepath));
 
@@ -150,7 +150,7 @@ TEST_F(FileUtilTest, Unlink) {
 #ifdef OS_WIN
 TEST_F(FileUtilTest, HideFile) {
   const string filename =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testfile");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testfile");
   FileUtil::Unlink(filename);
 
   EXPECT_FALSE(FileUtil::HideFile(filename));
@@ -198,9 +198,9 @@ TEST_F(FileUtilTest, HideFile) {
 
 TEST_F(FileUtilTest, IsEqualFile) {
   const std::string filename1 =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test1");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test1");
   const std::string filename2 =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test2");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test2");
   FileUtil::Unlink(filename1);
   FileUtil::Unlink(filename2);
   EXPECT_FALSE(FileUtil::IsEqualFile(filename1, filename2));
@@ -224,9 +224,9 @@ TEST_F(FileUtilTest, IsEqualFile) {
 TEST_F(FileUtilTest, CopyFile) {
   // just test rename operation works as intended
   const std::string from =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "copy_from");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "copy_from");
   const std::string to =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "copy_to");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "copy_to");
   FileUtil::Unlink(from);
   FileUtil::Unlink(to);
 
@@ -292,9 +292,9 @@ TEST_F(FileUtilTest, CopyFile) {
 
 TEST_F(FileUtilTest, AtomicRename) {
   // just test rename operation works as intended
-  const std::string from = FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir),
+  const std::string from = FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir),
                                               "atomic_rename_test_from");
-  const std::string to = FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir),
+  const std::string to = FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir),
                                             "atomic_rename_test_to");
   FileUtil::Unlink(from);
   FileUtil::Unlink(to);
@@ -455,7 +455,7 @@ TEST_F(FileUtilTest, GetModificationTime) {
   EXPECT_FALSE(FileUtil::GetModificationTime("not_existent_file", &time_stamp));
 
   const std::string &path =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testfile");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testfile");
   CreateTestFile(path, "content");
   EXPECT_TRUE(FileUtil::GetModificationTime(path, &time_stamp));
   EXPECT_NE(0, time_stamp);
diff --git base/flags.cc base/flags.cc
deleted file mode 100644
index b01f56893..000000000
--- base/flags.cc
+++ /dev/null
@@ -1,320 +0,0 @@
-// Copyright 2010-2021, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "base/flags.h"
-
-#include <cstring>
-#include <iostream>
-#include <map>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/port.h"
-#include "base/singleton.h"
-
-namespace mozc_flags {
-
-struct Flag {
-  int type;
-  void *storage;
-  const void *default_storage;
-  string help;
-};
-
-namespace {
-
-typedef std::map<string, mozc_flags::Flag *> FlagMap;
-
-FlagMap *GetFlagMap() { return mozc::Singleton<FlagMap>::get(); }
-
-bool IsTrue(const char *value) {
-  const char *kTrue[] = {"1", "t", "true", "y", "yes"};
-  const char *kFalse[] = {"0", "f", "false", "n", "no"};
-  for (size_t i = 0; i < arraysize(kTrue); ++i) {
-    if (strcmp(value, kTrue[i]) == 0) {
-      return true;
-    } else if (strcmp(value, kFalse[i]) == 0) {
-      return false;
-    }
-  }
-  return false;
-}
-
-// Wraps std::sto* functions by a template class so that appropriate functions
-// are chosen for platform-dependent integral types by type deduction.  For
-// example, if int64 is defined as long long, then StrToNumberImpl<int64>::Do()
-// is mapped to StrToNumberImpl::Do<long long>().  Here, struct (class) is
-// intentionally used instead of a template function because, if we use a
-// function, compiler may warn of "unused function".
-template <typename T>
-struct StrToNumberImpl;
-
-template <>
-struct StrToNumberImpl<int> {
-  static int Do(const string &s) { return std::stoi(s); }
-};
-
-template <>
-struct StrToNumberImpl<long> {                              // NOLINT
-  static long Do(const string &s) { return std::stol(s); }  // NOLINT
-};
-
-template <>
-struct StrToNumberImpl<long long> {                               // NOLINT
-  static long long Do(const string &s) { return std::stoll(s); }  // NOLINT
-};
-
-template <>
-struct StrToNumberImpl<unsigned long> {                               // NOLINT
-  static unsigned long Do(const string &s) { return std::stoul(s); }  // NOLINT
-};
-
-template <>
-struct StrToNumberImpl<unsigned long long> {       // NOLINT
-  static unsigned long long Do(const string &s) {  // NOLINT
-    return std::stoull(s);
-  }
-};
-
-template <typename T>
-inline T StrToNumber(const string &s) {
-  return StrToNumberImpl<T>::Do(s);
-}
-
-#if defined(DEBUG) || defined(__APPLE__)
-// Defines std::string version of absl::string_view::starts_with here to make
-// flags module from independent of string_piece.cc because absl::string_view
-// depends on logging.cc etc. and using it causes cyclic dependency.
-inline bool StartsWith(const string &s, const string &prefix) {
-  return s.size() >= prefix.size() &&
-         memcmp(s.data(), prefix.data(), prefix.size()) == 0;
-}
-#endif  // defined(DEBUG) || defined(__APPLE__)
-
-}  // namespace
-
-FlagRegister::FlagRegister(const char *name, void *storage,
-                           const void *default_storage, int shorttpe,
-                           const char *help)
-    : flag_(new Flag) {
-  flag_->type = shorttpe;
-  flag_->storage = storage;
-  flag_->default_storage = default_storage;
-  flag_->help = help;
-  GetFlagMap()->insert(std::make_pair(string(name), flag_));
-}
-
-FlagRegister::~FlagRegister() { delete flag_; }
-
-bool SetFlag(const string &name, const string &value) {
-  std::map<string, Flag *>::iterator it = GetFlagMap()->find(name);
-  if (it == GetFlagMap()->end()) return false;
-  string v = value;
-  Flag *flag = it->second;
-
-  // If empty value is set, we assume true or empty string is set
-  // for boolean or string option. With other types, setting fails.
-  if (value.empty()) {
-    switch (flag->type) {
-      case B:
-        v = "true";
-        break;
-      case S:
-        v = "";
-        break;
-      default:
-        return false;
-    }
-  }
-
-  switch (flag->type) {
-    case I:
-      *reinterpret_cast<int32 *>(flag->storage) = StrToNumber<int32>(v);
-      break;
-    case B:
-      *(reinterpret_cast<bool *>(flag->storage)) = IsTrue(v.c_str());
-      break;
-    case I64:
-      *reinterpret_cast<int64 *>(flag->storage) = StrToNumber<int64>(v);
-      break;
-    case U64:
-      *reinterpret_cast<uint64 *>(flag->storage) = StrToNumber<uint64>(v);
-      break;
-    case D:
-      *reinterpret_cast<double *>(flag->storage) = strtod(v.c_str(), nullptr);
-      break;
-    case S:
-      *reinterpret_cast<string *>(flag->storage) = v;
-      break;
-    default:
-      break;
-  }
-  return true;
-}
-
-namespace {
-
-#ifndef IGNORE_HELP_FLAG
-
-void PrintFlags(string *output) {
-  std::ostringstream os;
-  for (std::map<string, Flag *>::const_iterator it = GetFlagMap()->begin();
-       it != GetFlagMap()->end(); ++it) {
-    os << "   --" << it->first << " (" << it->second->help << ")";
-    const Flag *flag = it->second;
-    switch (flag->type) {
-      case I:
-        os << "  type: int32  default: "
-           << *(reinterpret_cast<const int *>(flag->default_storage))
-           << std::endl;
-        break;
-      case B:
-        os << "  type: bool  default: "
-           << (*(reinterpret_cast<const bool *>(flag->default_storage))
-                   ? "true"
-                   : "false")
-           << std::endl;
-        break;
-      case I64:
-        os << "  type: int64 default: "
-           << *(reinterpret_cast<const int64 *>(flag->default_storage))
-           << std::endl;
-        break;
-      case U64:
-        os << "  type: uint64  default: "
-           << *(reinterpret_cast<const uint64 *>(flag->default_storage))
-           << std::endl;
-        break;
-      case D:
-        os << "  type: double  default: "
-           << *(reinterpret_cast<const double *>(flag->default_storage))
-           << std::endl;
-        break;
-      case S:
-        os << "  type: string  default: "
-           << *(reinterpret_cast<const string *>(flag->default_storage))
-           << std::endl;
-        break;
-      default:
-        break;
-    }
-  }
-  *output = os.str();
-}
-
-#endif  // IGNORE_HELP_FLAG
-
-bool CommandLineGetFlag(int argc, char **argv, string *key, string *value,
-                        int *used_args) {
-  key->clear();
-  value->clear();
-  *used_args = 0;
-  if (argc < 1) {
-    return false;
-  }
-
-  *used_args = 1;
-  const char *start = argv[0];
-  if (start[0] != '-') {
-    return false;
-  }
-
-  ++start;
-  if (start[0] == '-') ++start;
-  const string arg = start;
-  const size_t n = arg.find("=");
-  if (n != string::npos) {
-    *key = arg.substr(0, n);
-    *value = arg.substr(n + 1, arg.size() - n);
-    return true;
-  }
-
-  key->assign(arg);
-  value->clear();
-
-  if (argc == 1) {
-    return true;
-  }
-  start = argv[1];
-  if (start[0] == '-') {
-    return true;
-  }
-
-  *used_args = 2;
-  value->assign(start);
-  return true;
-}
-
-}  // namespace
-
-uint32 ParseCommandLineFlags(int *argc, char ***argv) {
-  int used_argc = 0;
-  string key, value;
-  for (int i = 1; i < *argc; i += used_argc) {
-    if (!CommandLineGetFlag(*argc - i, *argv + i, &key, &value, &used_argc)) {
-      // TODO(komatsu): Do error handling
-      continue;
-    }
-
-    if (key == "help") {
-#ifndef IGNORE_HELP_FLAG
-      string help;
-      PrintFlags(&help);
-      std::cout << help;
-      exit(0);
-#endif
-    }
-#ifdef DEBUG
-    // Ignores unittest specific commandline flags.
-    // In the case of Release build, IGNORE_INVALID_FLAG macro is set, so that
-    // following condition makes no sense.
-    if (StartsWith(key, "gtest_") || StartsWith(key, "gunit_")) {
-      continue;
-    }
-#endif  // DEBUG
-#ifdef __APPLE__
-    // Mac OSX specifies process serial number like -psn_0_217141.
-    // Let's ignore it.
-    if (StartsWith(key, "psn_")) {
-      continue;
-    }
-#endif
-    if (!SetFlag(key, value)) {
-#ifndef IGNORE_INVALID_FLAG
-      std::cerr << "Unknown/Invalid flag " << key << std::endl;
-      exit(1);
-#endif
-    }
-  }
-  return *argc;
-}
-
-}  // namespace mozc_flags
-
diff --git base/flags.h base/flags.h
index 3bd878fa2..9e5ea80b9 100644
--- base/flags.h
+++ base/flags.h
@@ -33,94 +33,7 @@
 #define MOZC_BASE_FLAGS_H_
 
 #include "base/port.h"
-
-#include <string>
-
-namespace mozc_flags {
-
-enum { I, B, I64, U64, D, S };
-
-struct Flag;
-
-class FlagRegister {
- public:
-  FlagRegister(const char *name, void *storage, const void *default_storage,
-               int shorttpe, const char *help);
-  ~FlagRegister();
-
- private:
-  Flag *flag_;
-};
-
-uint32 ParseCommandLineFlags(int *argc, char ***argv);
-bool SetFlag(const string &key, const string &value);
-
-}  // namespace mozc_flags
-
-#define DEFINE_VARIABLE(type, shorttype, name, value, help)               \
-  namespace mozc_flags_fL##shorttype {                                    \
-    using mozc_flags::shorttype;                                          \
-    type FLAGS_##name = value;                                            \
-    static const type FLAGS_DEFAULT_##name = value;                       \
-    static const mozc_flags::FlagRegister fL##name(                       \
-        #name, reinterpret_cast<void *>(&FLAGS_##name),                   \
-        reinterpret_cast<const void *>(&FLAGS_DEFAULT_##name), shorttype, \
-        help);                                                            \
-  }                                                                       \
-  using mozc_flags_fL##shorttype::FLAGS_##name
-
-#define DECLARE_VARIABLE(type, shorttype, name) \
-  namespace mozc_flags_fL##shorttype {          \
-    extern type FLAGS_##name;                   \
-  }                                             \
-  using mozc_flags_fL##shorttype::FLAGS_##name
-
-#define DEFINE_int32(name, value, help) \
-  DEFINE_VARIABLE(int32, I, name, value, help)
-#define DECLARE_int32(name) DECLARE_VARIABLE(int32, I, name)
-
-#define DEFINE_int64(name, value, help) \
-  DEFINE_VARIABLE(int64, I64, name, value, help)
-#define DECLARE_int64(name) DECLARE_VARIABLE(int64, I64, name)
-
-#define DEFINE_uint64(name, value, help) \
-  DEFINE_VARIABLE(uint64, U64, name, value, help)
-#define DECLARE_uint64(name) DECLARE_VARIABLE(uint64, U64, name)
-
-#define DEFINE_double(name, value, help) \
-  DEFINE_VARIABLE(double, D, name, value, help)
-#define DECLARE_double(name) DECLARE_VARIABLE(double, D, name)
-
-#define DEFINE_bool(name, value, help) \
-  DEFINE_VARIABLE(bool, B, name, value, help)
-#define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name)
-
-#define DEFINE_string(name, value, help) \
-  DEFINE_VARIABLE(string, S, name, value, help)
-#define DECLARE_string(name) DECLARE_VARIABLE(string, S, name)
-
-#define MOZC_FLAG(type, name, value, help) \
-  DEFINE_##type(name, value, help)
-
-#define MOZC_DECLARE_FLAG(type, name) \
-  DECLARE_##type(name)
-
-namespace mozc {
-
-inline bool GetFlag(bool flag) { return flag; }
-inline int32 GetFlag(int32 flag) { return flag; }
-inline int64 GetFlag(int64 flag) { return flag; }
-inline uint64 GetFlag(uint64 flag) { return flag; }
-inline double GetFlag(double flag) { return flag; }
-inline string GetFlag(const string &flag) { return flag; }
-
-inline void SetFlag(bool *f, bool v) { *f = v; }
-inline void SetFlag(int32 *f, int32 v) { *f = v; }
-inline void SetFlag(int64 *f, int64 v) { *f = v; }
-inline void SetFlag(uint64 *f, uint64 v) { *f = v; }
-inline void SetFlag(double *f, double v) { *f = v; }
-inline void SetFlag(string *f, const string &v) { *f = v; }
-
-}  // namespace mozc
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
 #endif  // MOZC_BASE_FLAGS_H_
diff --git base/flags_test.cc base/flags_test.cc
deleted file mode 100644
index 4453a8754..000000000
--- base/flags_test.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2010-2021, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "base/flags.h"
-
-#include <cstring>
-
-#include "testing/base/public/gunit.h"
-
-using std::string;
-
-MOZC_FLAG(string, test_string, "hogehoge", "test_string");
-MOZC_FLAG(int32, test_int32, 20, "test_int32");
-MOZC_FLAG(int64, test_int64, 29051773239673121LL, "test_int64");
-MOZC_FLAG(uint64, test_uint64, 84467440737095516LL, "test_uint64");
-MOZC_FLAG(bool, test_bool, false, "test_bool");
-MOZC_FLAG(double, test_double, 0.5, "test_double");
-
-namespace mozc {
-namespace {
-
-char *strdup_with_new(const char *str) {
-  char *result = new char[strlen(str) + 1];
-  strcpy(result, str);
-  return result;
-}
-
-class FlagsTest : public testing::Test {
- protected:
-  void SetUp() override {
-    mozc::SetFlag(&FLAGS_test_string, "hogehoge");
-    mozc::SetFlag(&FLAGS_test_int32, 20);
-    mozc::SetFlag(&FLAGS_test_int64, 29051773239673121LL);
-    mozc::SetFlag(&FLAGS_test_uint64, 84467440737095516LL);
-    mozc::SetFlag(&FLAGS_test_bool, false);
-    mozc::SetFlag(&FLAGS_test_double, 0.5);
-  }
-};
-
-TEST_F(FlagsTest, FlagsBasicTest) {
-  EXPECT_FALSE(mozc::GetFlag(FLAGS_test_bool));
-  EXPECT_EQ(20, mozc::GetFlag(FLAGS_test_int32));
-  EXPECT_EQ(int64{29051773239673121}, mozc::GetFlag(FLAGS_test_int64));
-  EXPECT_EQ(int64{84467440737095516}, mozc::GetFlag(FLAGS_test_uint64));
-  EXPECT_EQ("hogehoge", mozc::GetFlag(FLAGS_test_string));
-  EXPECT_LT(0.4, mozc::GetFlag(FLAGS_test_double));
-  EXPECT_GT(0.6, mozc::GetFlag(FLAGS_test_double));
-
-  char **argv = new char *[8];
-  argv[0] = strdup_with_new("test");
-  argv[1] = strdup_with_new("--test_int32=11214141");
-  argv[2] = strdup_with_new("--test_string=test");
-  argv[3] = strdup_with_new("--test_bool=true");
-  argv[4] = strdup_with_new("--test_double=1.5");
-  argv[5] = strdup_with_new("--test_int64=8172141141413124");
-  argv[6] = strdup_with_new("--test_uint64=9414041694169841");
-  argv[7] = strdup_with_new("invalid_value");
-  int argc = 8;
-  const uint32 used_argc = mozc_flags::ParseCommandLineFlags(&argc, &argv);
-  for (size_t i = 0; i < argc; ++i) {
-    delete[] argv[i];
-  }
-  delete[] argv;
-
-  EXPECT_EQ(8u, used_argc);
-  EXPECT_EQ(true, mozc::GetFlag(FLAGS_test_bool));
-  EXPECT_EQ(11214141, mozc::GetFlag(FLAGS_test_int32));
-  EXPECT_EQ(8172141141413124LL, mozc::GetFlag(FLAGS_test_int64));
-  EXPECT_EQ(9414041694169841LL, mozc::GetFlag(FLAGS_test_uint64));
-  EXPECT_EQ("test", mozc::GetFlag(FLAGS_test_string));
-  EXPECT_LT(1.4, mozc::GetFlag(FLAGS_test_double));
-  EXPECT_GT(1.6, mozc::GetFlag(FLAGS_test_double));
-}
-
-TEST_F(FlagsTest, NoValuesFlagsTest) {
-  EXPECT_FALSE(mozc::GetFlag(FLAGS_test_bool));
-  EXPECT_EQ(20, mozc::GetFlag(FLAGS_test_int32));
-  EXPECT_EQ(int64{29051773239673121}, mozc::GetFlag(FLAGS_test_int64));
-  EXPECT_EQ(int64{84467440737095516}, mozc::GetFlag(FLAGS_test_uint64));
-  EXPECT_EQ("hogehoge", mozc::GetFlag(FLAGS_test_string));
-  EXPECT_LT(0.4, mozc::GetFlag(FLAGS_test_double));
-  EXPECT_GT(0.6, mozc::GetFlag(FLAGS_test_double));
-
-  char **argv = new char *[3];
-  // We set only boolean and string values, because other types will stops
-  // the test process if empty values are set.
-  argv[0] = strdup_with_new("test");
-  argv[1] = strdup_with_new("--test_string");
-  argv[2] = strdup_with_new("--test_bool");
-  int argc = 3;
-  const uint32 used_argc = mozc_flags::ParseCommandLineFlags(&argc, &argv);
-  for (size_t i = 0; i < argc; ++i) {
-    delete[] argv[i];
-  }
-  delete[] argv;
-
-  EXPECT_EQ(3u, used_argc);
-  EXPECT_TRUE(mozc::GetFlag(FLAGS_test_bool));
-  EXPECT_EQ("", mozc::GetFlag(FLAGS_test_string));
-  // Following values are kept as default.
-  EXPECT_EQ(20, mozc::GetFlag(FLAGS_test_int32));
-  EXPECT_EQ(29051773239673121LL, mozc::GetFlag(FLAGS_test_int64));
-  EXPECT_EQ(84467440737095516LL, mozc::GetFlag(FLAGS_test_uint64));
-  EXPECT_LT(0.4, mozc::GetFlag(FLAGS_test_double));
-  EXPECT_GT(0.6, mozc::GetFlag(FLAGS_test_double));
-}
-
-TEST_F(FlagsTest, SetFlag) {
-  mozc_flags::SetFlag("test_bool", "true");
-  EXPECT_TRUE(mozc::GetFlag(FLAGS_test_bool));
-  mozc_flags::SetFlag("test_bool", "false");
-  EXPECT_FALSE(mozc::GetFlag(FLAGS_test_bool));
-
-  mozc_flags::SetFlag("test_int32", "12345");
-  EXPECT_EQ(12345, mozc::GetFlag(FLAGS_test_int32));
-
-  mozc_flags::SetFlag("test_int64", "10000000000000000");
-  EXPECT_EQ(10000000000000000LL, mozc::GetFlag(FLAGS_test_int64));
-
-  mozc_flags::SetFlag("test_uint64", "50000000000000000");
-  EXPECT_EQ(50000000000000000LL, mozc::GetFlag(FLAGS_test_uint64));
-
-  mozc_flags::SetFlag("test_string", "Tokyo");
-  EXPECT_EQ("Tokyo", mozc::GetFlag(FLAGS_test_string));
-
-  mozc_flags::SetFlag("test_double", "3.14");
-  EXPECT_DOUBLE_EQ(3.14, mozc::GetFlag(FLAGS_test_double));
-}
-
-}  // namespace
-}  // namespace mozc
diff --git base/gen_character_set.py base/gen_character_set.py
index 87a36e280..2b6b588a2 100644
--- base/gen_character_set.py
+++ base/gen_character_set.py
@@ -145,7 +145,7 @@ def _LoadExceptions():
         0x301C,  # WAVE DASH
         0xFF5E,  # FULL WIDTH TILDE
         0x2016,  # DOUBLE VERTICAL LINE
-        0x2225,  # PARALEL TO
+        0x2225,  # PARALLEL TO
         0x2212,  # MINUS SIGN
         0xFF0D,  # FULL WIDTH HYPHEN MINUS
         0x00A2,  # CENT SIGN
diff --git base/init_mozc.cc base/init_mozc.cc
index 010341048..eee8b6226 100644
--- base/init_mozc.cc
+++ base/init_mozc.cc
@@ -29,37 +29,40 @@
 
 #include "base/init_mozc.h"
 
-
 #ifdef OS_WIN
 #include <windows.h>
 #endif  // OS_WIN
 
 #include <string>
 
-#include "base/file_util.h"
-
-
-#include "base/flags.h"
 
+#include "base/file_util.h"
 #include "base/logging.h"
+
 #ifndef MOZC_BUILDTOOL_BUILD
 #include "base/system_util.h"
 #endif  // MOZC_BUILDTOOL_BUILD
 
+
+#include "absl/flags/flag.h"
+
+#include "absl/flags/parse.h"
+
 // Even if log_dir is modified in the middle of the process, the
 // logging directory will not be changed because the logging stream is
 // initialized in the very early initialization stage.
-MOZC_FLAG(string, log_dir, "",
+ABSL_FLAG(std::string, log_dir, "",
           "If specified, logfiles are written into this directory "
           "instead of the default logging directory.");
 
 
-MOZC_FLAG(string, program_invocation_name, "",
+ABSL_FLAG(std::string, program_invocation_name, "",
           "Program name copied from argv[0].");
 
 namespace mozc {
 namespace {
 
+
 #ifdef OS_WIN
 LONG CALLBACK ExitProcessExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo) {
   // Currently, we haven't found a good way to perform both
@@ -69,22 +72,33 @@ LONG CALLBACK ExitProcessExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo) {
 }
 #endif  // OS_WIN
 
-string GetLogFilePathFromProgramName(const string &program_name) {
-  const string basename = FileUtil::Basename(program_name) + ".log";
-  if (mozc::GetFlag(FLAGS_log_dir).empty()) {
+std::string GetLogFilePathFromProgramName(const std::string &program_name) {
+  const std::string basename = FileUtil::Basename(program_name) + ".log";
+  if (absl::GetFlag(FLAGS_log_dir).empty()) {
 #ifdef MOZC_BUILDTOOL_BUILD
     return basename;
 #else   // MOZC_BUILDTOOL_BUILD
     return FileUtil::JoinPath(SystemUtil::GetLoggingDirectory(), basename);
 #endif  // MOZC_BUILDTOOL_BUILD
   }
-  return FileUtil::JoinPath(mozc::GetFlag(FLAGS_log_dir), basename);
+  return FileUtil::JoinPath(absl::GetFlag(FLAGS_log_dir), basename);
 }
 
+void ParseCommandLineFlags(int argc, char **argv) {
+  absl::flags_internal::ParseCommandLineImpl(
+      argc, argv,
+      absl::flags_internal::ArgvListAction::kRemoveParsedArgs,
+      // Suppress help messages invoked by --help and others.
+      // Use UsageFlagsAction::kHandleUsage to enable it.
+      absl::flags_internal::UsageFlagsAction::kIgnoreUsage,
+      absl::flags_internal::OnUndefinedFlag::kIgnoreUndefined);
+}
+
+
 }  // namespace
 
 void InitMozc(const char *arg0, int *argc, char ***argv) {
-  mozc::SetFlag(&FLAGS_program_invocation_name, *argv[0]);
+  absl::SetFlag(&FLAGS_program_invocation_name, *argv[0]);
 #ifdef OS_WIN
   // InitMozc() is supposed to be used for code generator or
   // other programs which are not included in the production code.
@@ -93,9 +107,9 @@ void InitMozc(const char *arg0, int *argc, char ***argv) {
   // our continuous build stable.
   ::SetUnhandledExceptionFilter(ExitProcessExceptionFilter);
 #endif  // OS_WIN
-  mozc_flags::ParseCommandLineFlags(argc, argv);
+  ParseCommandLineFlags(*argc, *argv);
 
-  const string program_name = *argc > 0 ? (*argv)[0] : "UNKNOWN";
+  const std::string program_name = *argc > 0 ? (*argv)[0] : "UNKNOWN";
   Logging::InitLogStream(GetLogFilePathFromProgramName(program_name));
 
 }
diff --git base/logging.cc base/logging.cc
index 2ef09dfdc..a00a1badc 100644
--- base/logging.cc
+++ base/logging.cc
@@ -57,16 +57,16 @@
 #include "base/const.h"
 #endif  // OS_ANDROID
 #include "base/clock.h"
-#include "base/flags.h"
 #include "base/mutex.h"
 #include "base/singleton.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/str_cat.h"
 
-MOZC_FLAG(bool, colored_log, true,
+ABSL_FLAG(bool, colored_log, true,
           "Enables colored log messages on tty devices");
-MOZC_FLAG(bool, logtostderr, false,
+ABSL_FLAG(bool, logtostderr, false,
           "log messages go to stderr instead of logfiles");
-MOZC_FLAG(int32, v, 0, "verbose level");
+ABSL_FLAG(int32, v, 0, "verbose level");
 
 namespace mozc {
 
@@ -176,12 +176,12 @@ class LogStreamImpl {
   void Reset();
 
   int verbose_level() const {
-    return std::max(mozc::GetFlag(FLAGS_v), config_verbose_level_);
+    return std::max(absl::GetFlag(FLAGS_v), config_verbose_level_);
   }
 
   void set_verbose_level(int level) {
     scoped_lock l(&mutex_);
-    mozc::SetFlag(&FLAGS_v, level);
+    absl::SetFlag(&FLAGS_v, level);
   }
 
   void set_config_verbose_level(int level) {
@@ -273,11 +273,11 @@ void LogStreamImpl::Reset() {
   // Coloring is disabled on windows
   // because cmd.exe doesn't support ANSI color escape sequences.
   // TODO(team): Considers to use SetConsoleTextAttribute on Windows.
-  use_cerr_ = mozc::GetFlag(FLAGS_logtostderr);
+  use_cerr_ = absl::GetFlag(FLAGS_logtostderr);
   support_color_ = false;
 #else   // OS_ANDROID, OS_WIN
-  use_cerr_ = mozc::GetFlag(FLAGS_logtostderr);
-  support_color_ = (use_cerr_ && mozc::GetFlag(FLAGS_colored_log) &&
+  use_cerr_ = absl::GetFlag(FLAGS_logtostderr);
+  support_color_ = (use_cerr_ && absl::GetFlag(FLAGS_colored_log) &&
                     ::isatty(::fileno(stderr)));
 #endif  // OS_ANDROID, OS_WIN
 }
diff --git base/logging.h base/logging.h
index 180bf552e..5283af14f 100644
--- base/logging.h
+++ base/logging.h
@@ -34,8 +34,8 @@
 #include <iostream>
 #include <string>
 
-#include "base/flags.h"
 #include "base/port.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
diff --git base/mac_util.h base/mac_util.h
index bf512ba89..1bc4a508a 100644
--- base/mac_util.h
+++ base/mac_util.h
@@ -55,7 +55,7 @@ class MacUtil {
   // Returns server directory using OS-specific API.
   static string GetServerDirectory();
 
-  // Returns the "Resouces/" directory in the current application.
+  // Returns the "Resources/" directory in the current application.
   static string GetResourcesDirectory();
 
   // Returns the machine serial number.
@@ -83,7 +83,7 @@ class MacUtil {
   // Returns false if an error occurred.
   static bool GetFrontmostWindowNameAndOwner(string *name, string *owner);
 
-  // Returns true when Mozc's suggestion UI is expected to be surpressed on
+  // Returns true when Mozc's suggestion UI is expected to be suppressed on
   // the window specified by |name| and |owner|.
   static bool IsSuppressSuggestionWindow(const string &name,
                                          const string &owner);
diff --git base/mac_util_main.cc base/mac_util_main.cc
index ba0fb87d1..1632e1ea3 100644
--- base/mac_util_main.cc
+++ base/mac_util_main.cc
@@ -31,27 +31,27 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/mac_util.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, label_for_suffix, false,
+ABSL_FLAG(bool, label_for_suffix, false,
           "call GetLabelForSuffix when specified");
-MOZC_FLAG(bool, application_support_directory, false,
+ABSL_FLAG(bool, application_support_directory, false,
           "call GetApplicationSupportDirectory when specified");
-MOZC_FLAG(bool, logging_directory, false,
+ABSL_FLAG(bool, logging_directory, false,
           "call GetLoggingDirectory when specified");
-MOZC_FLAG(bool, os_version_string, false,
+ABSL_FLAG(bool, os_version_string, false,
           "call GetOSVersionString when specified");
-MOZC_FLAG(bool, server_directory, false,
+ABSL_FLAG(bool, server_directory, false,
           "call GetServerDirectory when specified");
-MOZC_FLAG(bool, serial_number, false, "call GetSerialNumber when specified");
-MOZC_FLAG(bool, start_launchd_service, false,
+ABSL_FLAG(bool, serial_number, false, "call GetSerialNumber when specified");
+ABSL_FLAG(bool, start_launchd_service, false,
           "call StartLaunchdService when specified");
 
-MOZC_FLAG(string, suffix, "", "The argument for GetLabelForSuffix");
-MOZC_FLAG(string, service_name, "", "The service name to be launched");
+ABSL_FLAG(std::string, suffix, "", "The argument for GetLabelForSuffix");
+ABSL_FLAG(std::string, service_name, "", "The service name to be launched");
 
 #ifdef __APPLE__
 using mozc::MacUtil;
@@ -61,37 +61,37 @@ int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
 #ifdef __APPLE__
-  if (mozc::GetFlag(FLAGS_label_for_suffix)) {
-    std::cout << MacUtil::GetLabelForSuffix(mozc::GetFlag(FLAGS_suffix))
+  if (absl::GetFlag(FLAGS_label_for_suffix)) {
+    std::cout << MacUtil::GetLabelForSuffix(absl::GetFlag(FLAGS_suffix))
               << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_application_support_directory)) {
+  if (absl::GetFlag(FLAGS_application_support_directory)) {
     std::cout << MacUtil::GetApplicationSupportDirectory() << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_logging_directory)) {
+  if (absl::GetFlag(FLAGS_logging_directory)) {
     std::cout << MacUtil::GetLoggingDirectory() << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_os_version_string)) {
+  if (absl::GetFlag(FLAGS_os_version_string)) {
     std::cout << MacUtil::GetOSVersionString() << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_server_directory)) {
+  if (absl::GetFlag(FLAGS_server_directory)) {
     std::cout << MacUtil::GetServerDirectory() << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_serial_number)) {
+  if (absl::GetFlag(FLAGS_serial_number)) {
     std::cout << MacUtil::GetSerialNumber() << std::endl;
   }
 
-  if (mozc::GetFlag(FLAGS_start_launchd_service)) {
-    if (mozc::GetFlag(FLAGS_service_name).empty()) {
+  if (absl::GetFlag(FLAGS_start_launchd_service)) {
+    if (absl::GetFlag(FLAGS_service_name).empty()) {
       std::cout << "Specify the service name to be launched" << std::endl;
     } else {
       pid_t pid;
-      MacUtil::StartLaunchdService(mozc::GetFlag(FLAGS_service_name), &pid);
+      MacUtil::StartLaunchdService(absl::GetFlag(FLAGS_service_name), &pid);
       std::cout << "pid: " << pid << std::endl;
     }
   }
diff --git base/mmap.h base/mmap.h
index 028903589..93b52642b 100644
--- base/mmap.h
+++ base/mmap.h
@@ -55,7 +55,7 @@ class Mmap : public MmapSyncInterface {
   // - The storage is (usually) solid state thus page-in/out is expected to
   //   be faster.
   // On Linux, in the kernel version >= 2.6.9, user process can mlock. In older
-  // kernel, it fails if the process is running in user priviledge.
+  // kernel, it fails if the process is running in user privilege.
   // TODO(team): Check if mlock is really necessary for Mac.
   static bool IsMLockSupported();
   static int MaybeMLock(const void *addr, size_t len);
diff --git base/mmap_test.cc base/mmap_test.cc
index bdcea1a6f..160fb915b 100644
--- base/mmap_test.cc
+++ base/mmap_test.cc
@@ -34,17 +34,17 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
 
 TEST(MmapTest, MmapTest) {
   const std::string filename =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.db");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.db");
 
   const size_t kFileNameSize[] = {1, 100, 1024, 8192};
   for (int i = 0; i < arraysize(kFileNameSize); ++i) {
diff --git base/multifile_test.cc base/multifile_test.cc
index cb8b70d4a..c43c02eee 100644
--- base/multifile_test.cc
+++ base/multifile_test.cc
@@ -34,10 +34,10 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
@@ -51,10 +51,10 @@ TEST(InputMultiFileTest, OpenNonexistentFilesTest) {
     EXPECT_FALSE(multfile.ReadLine(&line));
   }
 
-  // Signle path
+  // Single path
   {
     const std::string path = FileUtil::JoinPath(
-        mozc::GetFlag(FLAGS_test_tmpdir), "this_file_does_not_exist");
+        absl::GetFlag(FLAGS_test_tmpdir), "this_file_does_not_exist");
     InputMultiFile multfile(path);
     std::string line;
     EXPECT_FALSE(multfile.ReadLine(&line));
@@ -66,11 +66,11 @@ TEST(InputMultiFileTest, OpenNonexistentFilesTest) {
   {
     std::vector<std::string> filenames;
     filenames.push_back(
-        FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "these_files"));
+        FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "these_files"));
     filenames.push_back(
-        FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "do_not"));
+        FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "do_not"));
     filenames.push_back(
-        FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "exists"));
+        FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "exists"));
 
     std::string joined_path;
     Util::JoinStrings(filenames, ",", &joined_path);
@@ -83,9 +83,9 @@ TEST(InputMultiFileTest, OpenNonexistentFilesTest) {
 }
 
 TEST(InputMultiFileTest, ReadSingleFileTest) {
-  EXPECT_TRUE(FileUtil::DirectoryExists(mozc::GetFlag(FLAGS_test_tmpdir)));
+  EXPECT_TRUE(FileUtil::DirectoryExists(absl::GetFlag(FLAGS_test_tmpdir)));
   const std::string path =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "i_am_a_test_file");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "i_am_a_test_file");
 
   // Create a test file
   std::vector<std::string> expected_lines;
@@ -113,7 +113,7 @@ TEST(InputMultiFileTest, ReadSingleFileTest) {
 }
 
 TEST(InputMultiFileTest, ReadMultipleFilesTest) {
-  EXPECT_TRUE(FileUtil::DirectoryExists(mozc::GetFlag(FLAGS_test_tmpdir)));
+  EXPECT_TRUE(FileUtil::DirectoryExists(absl::GetFlag(FLAGS_test_tmpdir)));
 
   const int kNumFile = 3;
   const int kNumLinesPerFile = 10;
@@ -126,7 +126,7 @@ TEST(InputMultiFileTest, ReadMultipleFilesTest) {
     for (int fileno = 0; fileno < kNumFile; ++fileno) {
       std::string filename = Util::StringPrintf("testfile%d", fileno);
       std::string path =
-          FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), filename);
+          FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), filename);
       paths.push_back(path);
 
       OutputFileStream ofs(path.c_str());
diff --git base/number_util.cc base/number_util.cc
index b1f776978..fb3fe08b7 100644
--- base/number_util.cc
+++ base/number_util.cc
@@ -389,7 +389,7 @@ bool NumberUtil::ArabicToSeparatedArabic(absl::string_view input_num,
 namespace {
 
 // use default for wide Arabic, because half/full width for
-// normal number is learned by charactor form manager.
+// normal number is learned by character form manager.
 const NumberStringVariation kSingleDigitsVariations[] = {
     {kNumKanjiDigits, 10, "漢数字", nullptr, nullptr,
      NumberUtil::NumberString::NUMBER_KANJI_ARABIC},
diff --git base/number_util_test.cc base/number_util_test.cc
index 3582ade3a..3604aa0fa 100644
--- base/number_util_test.cc
+++ base/number_util_test.cc
@@ -583,7 +583,7 @@ TEST(NumberUtilTest, KanjiNumberToArabicNumber) {
 }
 
 TEST(NumberUtilTest, NormalizeNumbers) {
-  // An element has input, expected Kanji output, and exepcted Arabic output.
+  // An element has input, expected Kanji output, and expected Arabic output.
   const char *success_data[][3] = {
       {"一", "一", "1"},
       {"九", "九", "9"},
@@ -641,7 +641,7 @@ TEST(NumberUtilTest, NormalizeNumbers) {
     EXPECT_EQ(success_data[i][2], arabic_output);
   }
 
-  // An element has input, expected Kanji output, and exepcted Arabic output.
+  // An element has input, expected Kanji output, and expected Arabic output.
   const char *success_notrim_data[][3] = {
       {"012", "〇一二", "012"},
       {"000", "〇〇〇", "000"},
diff --git base/password_manager.cc base/password_manager.cc
index 9e35f23c9..0ca8194b7 100644
--- base/password_manager.cc
+++ base/password_manager.cc
@@ -135,7 +135,7 @@ bool LoadPassword(std::string *password) {
     return false;
   }
 
-  // Seems that the size of DPAPI-encrypted-mesage
+  // Seems that the size of DPAPI-encrypted-message
   // becomes bigger than the original message.
   // Typical file size is 32 * 5 = 160byte.
   // We just set the maximum file size to be 4096byte just in case.
diff --git base/password_manager_main.cc base/password_manager_main.cc
index 41fa60428..6af134eb6 100644
--- base/password_manager_main.cc
+++ base/password_manager_main.cc
@@ -27,11 +27,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/password_manager.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
diff --git base/password_manager_test.cc base/password_manager_test.cc
index b9776d00a..35ba43725 100644
--- base/password_manager_test.cc
+++ base/password_manager_test.cc
@@ -29,14 +29,14 @@
 
 #include "base/password_manager.h"
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 TEST(PasswordManager, PasswordManagerTest) {
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
   std::string password1, password2;
   EXPECT_TRUE(PasswordManager::InitPassword());
diff --git base/process.h base/process.h
index ca906f39e..dc3ffe744 100644
--- base/process.h
+++ base/process.h
@@ -65,7 +65,7 @@ class Process {
   static bool WaitProcess(size_t pid, int timeout);
 
   // Returns true if a process having |pid| is still alive.
-  // if the the current thread has no permission to get the status or
+  // if the current thread has no permission to get the status or
   // operation failed in system call, it returns |default_result|.
   // TODO(all):
   // Note that there is the case where the specified thread/process has already
diff --git base/process_main.cc base/process_main.cc
index 7b2405732..dfb2111b5 100644
--- base/process_main.cc
+++ base/process_main.cc
@@ -29,24 +29,24 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/process.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, open_browser, "", "URL");
-MOZC_FLAG(string, spawn_process, "", "path");
+ABSL_FLAG(std::string, open_browser, "", "URL");
+ABSL_FLAG(std::string, spawn_process, "", "path");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  if (!mozc::GetFlag(FLAGS_open_browser).empty()) {
-    if (!mozc::Process::OpenBrowser(mozc::GetFlag(FLAGS_open_browser))) {
-      LOG(INFO) << "Failed to open: " << mozc::GetFlag(FLAGS_open_browser);
+  if (!absl::GetFlag(FLAGS_open_browser).empty()) {
+    if (!mozc::Process::OpenBrowser(absl::GetFlag(FLAGS_open_browser))) {
+      LOG(INFO) << "Failed to open: " << absl::GetFlag(FLAGS_open_browser);
     }
   }
-  if (!mozc::GetFlag(FLAGS_spawn_process).empty()) {
-    if (!mozc::Process::SpawnProcess(mozc::GetFlag(FLAGS_spawn_process), "")) {
-      LOG(INFO) << "Failed to spawn: " << mozc::GetFlag(FLAGS_spawn_process);
+  if (!absl::GetFlag(FLAGS_spawn_process).empty()) {
+    if (!mozc::Process::SpawnProcess(absl::GetFlag(FLAGS_spawn_process), "")) {
+      LOG(INFO) << "Failed to spawn: " << absl::GetFlag(FLAGS_spawn_process);
     }
   }
   return 0;
diff --git base/process_mutex.h base/process_mutex.h
index 68cf1ed4f..b8e411ea1 100644
--- base/process_mutex.h
+++ base/process_mutex.h
@@ -50,7 +50,7 @@
 // }
 //
 // foo.Lock();
-// /* process named "foo" is never instatiated inside this block */
+// /* process named "foo" is never instantiated inside this block */
 // foo.Unlock();
 
 namespace mozc {
diff --git base/process_mutex_main.cc base/process_mutex_main.cc
index 05bc2f46c..4b44b0111 100644
--- base/process_mutex_main.cc
+++ base/process_mutex_main.cc
@@ -34,28 +34,28 @@
 #endif  // OS_WIN
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(int32, sleep_time, 30, "sleep 30 sec");
-MOZC_FLAG(string, name, "named_event_test", "name for named event");
+ABSL_FLAG(int32, sleep_time, 30, "sleep 30 sec");
+ABSL_FLAG(std::string, name, "named_event_test", "name for named event");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  mozc::ProcessMutex mutex(mozc::GetFlag(FLAGS_name).c_str());
+  mozc::ProcessMutex mutex(absl::GetFlag(FLAGS_name).c_str());
 
   if (!mutex.Lock()) {
-    LOG(INFO) << "Process " << mozc::GetFlag(FLAGS_name)
+    LOG(INFO) << "Process " << absl::GetFlag(FLAGS_name)
               << " is already running";
     return -1;
   }
 
 #ifdef OS_WIN
-  ::Sleep(mozc::GetFlag(FLAGS_sleep_time) * 1000);
+  ::Sleep(absl::GetFlag(FLAGS_sleep_time) * 1000);
 #else
-  ::sleep(mozc::GetFlag(FLAGS_sleep_time));
+  ::sleep(absl::GetFlag(FLAGS_sleep_time));
 #endif
 
   mutex.UnLock();
diff --git base/process_mutex_test.cc base/process_mutex_test.cc
index d3050590f..b29af1c21 100644
--- base/process_mutex_test.cc
+++ base/process_mutex_test.cc
@@ -36,12 +36,12 @@
 #endif  // OS_WIN
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -51,7 +51,7 @@ class ProcessMutexTest : public testing::Test {
  protected:
   void SetUp() override {
     original_user_profile_dir_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   void TearDown() override {
diff --git base/run_level_main.cc base/run_level_main.cc
index c91f35b91..a12be8d92 100644
--- base/run_level_main.cc
+++ base/run_level_main.cc
@@ -31,12 +31,12 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/run_level.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, server, false, "server mode");
-MOZC_FLAG(bool, client, false, "client mode");
+ABSL_FLAG(bool, server, false, "server mode");
+ABSL_FLAG(bool, client, false, "client mode");
 
 // This is a simple command line tool
 // too check RunLevel class
@@ -45,9 +45,9 @@ int main(int argc, char **argv) {
 
   mozc::RunLevel::RequestType type = mozc::RunLevel::SERVER;
 
-  if (mozc::GetFlag(FLAGS_client)) {
+  if (absl::GetFlag(FLAGS_client)) {
     type = mozc::RunLevel::CLIENT;
-  } else if (mozc::GetFlag(FLAGS_server)) {
+  } else if (absl::GetFlag(FLAGS_server)) {
     type = mozc::RunLevel::SERVER;
   }
 
diff --git base/scheduler.h base/scheduler.h
index 75160258c..ec25a26e3 100644
--- base/scheduler.h
+++ base/scheduler.h
@@ -30,7 +30,7 @@
 // Scheduler is a timer, call registered callback at a given interval.
 // Scheduler has following features.
 //  1. Backoff when the registered callback returns false.
-//    - When the backoff is occured, next try will be after 2 * interval msec.
+//    - When the backoff is occurred, next try will be after 2 * interval msec.
 //    - Interval will be doubled as long as callback returns false, but
 //      will not exceed max_interval.
 //  2. Randomised delayed start to reduce server traffic peak.
diff --git base/singleton_test.cc base/singleton_test.cc
index dea826ab2..c3b7e2031 100644
--- base/singleton_test.cc
+++ base/singleton_test.cc
@@ -81,8 +81,8 @@ TEST(SingletonTest, BasicTest) {
 }
 
 TEST(SingletonTest, ThreadTest) {
-  // call Singelton::get() at the same time from
-  // different threds. Make sure that get() returns
+  // call Singleton::get() at the same time from
+  // different threads. Make sure that get() returns
   // the same instance
 
   g_counter = 0;
diff --git base/stopwatch_main.cc base/stopwatch_main.cc
index 4d52a8350..3a656f8c6 100644
--- base/stopwatch_main.cc
+++ base/stopwatch_main.cc
@@ -30,19 +30,19 @@
 #include <iostream>
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/stopwatch.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(int32, sleep_time, 1000, "sleep time");
+ABSL_FLAG(int32, sleep_time, 1000, "sleep time");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::Stopwatch stopwatch;
   stopwatch.Start();
-  mozc::Util::Sleep(mozc::GetFlag(FLAGS_sleep_time));
+  mozc::Util::Sleep(absl::GetFlag(FLAGS_sleep_time));
   stopwatch.Stop();
   std::cout << stopwatch.GetElapsedMicroseconds() << std::endl;
 
diff --git base/unverified_aes256.h base/unverified_aes256.h
index e431bf6ea..ffae1e302 100644
--- base/unverified_aes256.h
+++ base/unverified_aes256.h
@@ -35,7 +35,7 @@
 namespace mozc {
 namespace internal {
 
-// Note that this implemenation is kept just for the backward compatibility
+// Note that this implementation is kept just for the backward compatibility
 // so that we can read previously obfuscated data.
 // !!! Not FIPS-certified.
 // !!! Performance optimization is not well considered.
diff --git base/unverified_sha1.h base/unverified_sha1.h
index 988fd1269..5b3a76f62 100644
--- base/unverified_sha1.h
+++ base/unverified_sha1.h
@@ -36,7 +36,7 @@
 namespace mozc {
 namespace internal {
 
-// Note that this implemenation is kept just for the backward compatibility
+// Note that this implementation is kept just for the backward compatibility
 // so that we can read previously obfuscated data.
 // !!! Not FIPS-certified.
 // !!! Performance optimization is not well considered.
diff --git base/win_sandbox.cc base/win_sandbox.cc
index 140ef6baa..fec250bb8 100644
--- base/win_sandbox.cc
+++ base/win_sandbox.cc
@@ -257,7 +257,7 @@ std::wstring WinSandbox::GetSDDL(ObjectSecurityType shareble_object_type,
                                  bool is_windows_8_or_later) {
   // See
   // http://social.msdn.microsoft.com/Forums/en-US/windowssecurity/thread/e92502b1-0b9f-4e02-9d72-e4e47e924a8f/
-  // for how to acess named objects from an AppContainer.
+  // for how to access named objects from an AppContainer.
 
   std::wstring dacl;
   std::wstring sacl;
@@ -1393,12 +1393,12 @@ bool WinSandbox::EnsureAllApplicationPackagesPermisssion(
   // Check if the desired ACE is already specified or not.
   for (UINT i = 0; i < dacl.GetAceCount(); ++i) {
     CSid ace_sid;
-    ACCESS_MASK acess_mask = 0;
+    ACCESS_MASK access_mask = 0;
     BYTE ace_type = 0;
-    dacl.GetAclEntry(i, &ace_sid, &acess_mask, &ace_type);
+    dacl.GetAclEntry(i, &ace_sid, &access_mask, &ace_type);
     if (ace_sid == all_application_packages &&
         ace_type == ACCESS_ALLOWED_ACE_TYPE &&
-        (acess_mask & kDesiredMask) == kDesiredMask) {
+        (access_mask & kDesiredMask) == kDesiredMask) {
       // This is the desired ACE.  There is nothing to do.
       return true;
     }
diff --git build_defs.bzl build_defs.bzl
index ccf4e6eae..d0d3fc57f 100644
--- build_defs.bzl
+++ build_defs.bzl
@@ -35,6 +35,8 @@
 load("//tools/build_defs:build_cleaner.bzl", "register_extension_info")
 load("//tools/build_defs:stubs.bzl", "pytype_strict_binary", "pytype_strict_library")
 load("//tools/build_rules/android_cc_test:def.bzl", "android_cc_test")
+load("//:config.bzl", "BRANDING", "MACOS_BUNDLE_ID_PREFIX", "MACOS_MIN_OS_VER")
+load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application")
 
 def cc_library_mozc(deps = [], **kwargs):
     """
@@ -80,12 +82,12 @@ def cc_test_mozc(name, tags = [], deps = [], **kwargs):
     if "no_android" not in tags:
         android_cc_test(
             name = name + "_android",
+            cc_test_name = name,
+            requires_full_emulation = requires_full_emulation,
             # "manual" prevents this target triggered by a wild card.
             # So that "blaze test ..." does not contain this target.
             # Otherwise it is too slow.
             tags = ["manual", "notap"],
-            cc_test_name = name,
-            requires_full_emulation = requires_full_emulation,
         )
 
 register_extension_info(
@@ -130,16 +132,45 @@ register_extension_info(
     label_regex_for_dep = "{extension_name}",
 )
 
-def objc_library_mozc(name, srcs = [], hdrs = [], deps = [], sdk_frameworks = [], **kwargs):
+def info_plist_mozc(name, srcs = [], outs = []):
+    native.genrule(
+        name = name,
+        srcs = srcs + ["//base:mozc_version_txt"],
+        outs = outs,
+        cmd = ("$(location //build_tools:tweak_info_plist)" +
+               " --output $@" +
+               " --input $(location " + srcs[0] + ")" +
+               " --version_file $(location //base:mozc_version_txt)" +
+               " --branding " + BRANDING),
+        exec_tools = ["//build_tools:tweak_info_plist"],
+    )
+
+def objc_library_mozc(name, srcs = [], hdrs = [], deps = [], proto_deps = [], sdk_frameworks = [], **kwargs):
+    # Because proto_library cannot be in deps of objc_library,
+    # cc_library as a wrapper is necessary as a workaround.
+    proto_deps_name = name + "_proto_deps"
+    native.cc_library(
+        name = proto_deps_name,
+        deps = proto_deps,
+    )
     native.objc_library(
         name = name,
         srcs = srcs,
         hdrs = hdrs,
-        deps = deps + ["//:macro"],
+        deps = deps + ["//:macro", proto_deps_name],
         sdk_frameworks = sdk_frameworks,
         **kwargs
     )
 
+def macos_application_mozc(name, bundle_name, bundle_id = None, **kwargs):
+    macos_application(
+        name = name,
+        bundle_id = bundle_id or (MACOS_BUNDLE_ID_PREFIX + "." + bundle_name),
+        bundle_name = bundle_name,
+        minimum_os_version = MACOS_MIN_OS_VER,
+        **kwargs
+    )
+
 def _get_value(args):
     for arg in args:
         if arg != None:
@@ -158,7 +189,8 @@ def select_mozc(
         oss_android = None,
         oss_linux = None,
         oss_macos = None,
-        wasm = None):
+        wasm = None,
+        windows = None):
     """select wrapper for target os selection.
 
     The priority of value checking:
@@ -181,6 +213,7 @@ def select_mozc(
       oss_linux: value for OSS Linux build.
       oss_macos: value for OSS macOS build.
       wasm: value for wasm build.
+      windows: value for Windows build. (placeholder)
 
     Returns:
       Generated select statement.
@@ -189,8 +222,9 @@ def select_mozc(
         "//tools/cc_target_os:android": _get_value([android, client, default]),
         "//tools/cc_target_os:apple": _get_value([ios, client, default]),
         "//tools/cc_target_os:chromiumos": _get_value([chromiumos, client, default]),
-        "//tools/cc_target_os:wasm": _get_value([wasm, client, default]),
         "//tools/cc_target_os:darwin": _get_value([macos, ios, client, default]),
+        "//tools/cc_target_os:wasm": _get_value([wasm, client, default]),
+        "//tools/cc_target_os:windows": _get_value([windows, client, default]),
         "//tools/cc_target_os:linux": _get_value([linux, client, default]),
         "//tools/cc_target_os:oss_android": _get_value([oss_android, oss, android, client, default]),
         "//tools/cc_target_os:oss_linux": _get_value([oss_linux, oss, linux, client, default]),
diff --git build_tools/copy_dll_and_symbol.py build_tools/copy_dll_and_symbol.py
index 0f871190f..e0177c2b0 100644
--- build_tools/copy_dll_and_symbol.py
+++ build_tools/copy_dll_and_symbol.py
@@ -82,12 +82,13 @@ def _GetLastModifiedTime(filepath):
     Args:
       filepath: A string which represents the filename to be checked.
 
-      Returns:
-        A Datetime object which represents the last modified time of the
-        specified filename. If the file does not exist, returns epoch time.
+    Returns:
+      A Datetime object which represents the last modified time of the
+      specified filename. If the file does not exist, returns epoch time +1 day.
     """
     if not os.path.isfile(filepath):
-      return datetime.datetime.fromtimestamp(0)
+      # The epoch time doesn't work in some timezones. 86400 = 24 * 60 * 60.
+      return datetime.datetime.fromtimestamp(86400)
     return datetime.datetime.fromtimestamp(os.path.getmtime(filepath))
 
   target_file_mtime = _GetLastModifiedTime(target_file_abspath)
diff --git build_tools/mozc_win32_resource_template.rc build_tools/mozc_win32_resource_template.rc
index 72f401f66..7776912d8 100644
Binary files build_tools/mozc_win32_resource_template.rc and build_tools/mozc_win32_resource_template.rc differ
diff --git client/BUILD client/BUILD
index 099654818..840880f62 100644
--- client/BUILD
+++ client/BUILD
@@ -127,7 +127,6 @@ cc_binary_mozc(
     deps = [
         ":client",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:process",
@@ -142,7 +141,6 @@ cc_binary_mozc(
         ":client",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
@@ -162,7 +160,6 @@ cc_binary_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
@@ -185,7 +182,6 @@ cc_binary_mozc(
         ":client",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
@@ -206,9 +202,9 @@ cc_binary_mozc(
     deps = [
         ":client",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -237,7 +233,6 @@ cc_binary_mozc(
         ":client",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:multifile",
diff --git client/client.h client/client.h
index 3c7224489..0d4d52aed 100644
--- client/client.h
+++ client/client.h
@@ -51,7 +51,7 @@ class Config;
 
 namespace client {
 
-// default ServerLauncher implemntation.
+// default ServerLauncher implementation.
 // This class uses fork&exec (linux/mac) and CreateProcess() (Windows)
 // to launch server process
 class ServerLauncher : public ServerLauncherInterface {
@@ -177,8 +177,9 @@ class Client : public ClientInterface {
                            const std::string &label) const;
 
   // Start server:
-  // return true if server is launched sucessfully or server is already running.
-  // return false if server cannot be launched.
+  // * Return true if server is launched successfully or server is already
+  //   running.
+  // * Return false if server cannot be launched.
   // If server_program is empty, which is default setting, the path to
   // GoogleJapaneseInputConverter is determined automatically.
   // Windows: "C:\Program Files\Google\Google Japanese Input\"
diff --git client/client_interface.h client/client_interface.h
index 14f1313c2..8a1ea88bc 100644
--- client/client_interface.h
+++ client/client_interface.h
@@ -73,7 +73,7 @@ class ServerLauncherInterface {
   // Wait server until it terminates
   virtual bool WaitServer(uint32 pid) = 0;
 
-  // called when fatal error occured.
+  // called when fatal error occurred.
   virtual void OnFatal(ServerErrorType type) = 0;
 
   // set the full path of server program.
@@ -121,7 +121,7 @@ class ClientInterface {
   // Checks protocol/product version.
   // If a  new version is avaialable, restart the server.
   // return true the server is available.
-  // return false some error happend during the server restart.
+  // return false some error happened during the server restart.
   // This method calls EnsureConnection automatically.
   virtual bool CheckVersionOrRestartServer() = 0;
 
@@ -181,7 +181,7 @@ class ClientInterface {
   // Cleanup un-used sessions
   virtual bool Cleanup() = 0;
 
-  // Resets internal state (changs the state to be SERVER_UNKNWON)
+  // Resets internal state (changs the state to be SERVER_UNKNOWN)
   virtual void Reset() = 0;
 
   // Returns true if server is alive.
@@ -200,7 +200,7 @@ class ClientInterface {
   virtual void set_timeout(int timeout) = 0;
 
   // Sets restricted mode.
-  // server is launched inside restricted enviroment.
+  // server is launched inside restricted environment.
   virtual void set_restricted(bool restricted) = 0;
 
   // Sets server program path.
diff --git client/client_performance_test_main.cc client/client_performance_test_main.cc
index defdb2eda..3a377628f 100644
--- client/client_performance_test_main.cc
+++ client/client_performance_test_main.cc
@@ -35,7 +35,6 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
@@ -48,8 +47,8 @@
 #include "session/random_keyevents_generator.h"
 #include "absl/flags/flag.h"
 
-MOZC_FLAG(string, server_path, "", "specify server path");
-MOZC_FLAG(string, log_path, "", "specify log output file path");
+ABSL_FLAG(std::string, server_path, "", "specify server path");
+ABSL_FLAG(std::string, log_path, "", "specify log output file path");
 
 namespace mozc {
 namespace {
@@ -100,8 +99,8 @@ class TestScenarioInterface {
   virtual void Run(Result *result) = 0;
 
   TestScenarioInterface() {
-    if (!mozc::GetFlag(FLAGS_server_path).empty()) {
-      client_.set_server_program(mozc::GetFlag(FLAGS_server_path));
+    if (!absl::GetFlag(FLAGS_server_path).empty()) {
+      client_.set_server_program(absl::GetFlag(FLAGS_server_path));
     }
     CHECK(client_.IsValidRunLevel()) << "IsValidRunLevel failed";
     CHECK(client_.EnsureSession()) << "EnsureSession failed";
@@ -378,8 +377,8 @@ int main(int argc, char **argv) {
   CHECK_EQ(results.size(), tests.size());
 
   std::ostream *ofs = &std::cout;
-  if (!mozc::GetFlag(FLAGS_log_path).empty()) {
-    ofs = new mozc::OutputFileStream(mozc::GetFlag(FLAGS_log_path).c_str());
+  if (!absl::GetFlag(FLAGS_log_path).empty()) {
+    ofs = new mozc::OutputFileStream(absl::GetFlag(FLAGS_log_path).c_str());
   }
 
   // TODO(taku): generate histogram with ChartAPI
diff --git client/client_quality_test_main.cc client/client_quality_test_main.cc
index d43d203f9..a88baac88 100644
--- client/client_quality_test_main.cc
+++ client/client_quality_test_main.cc
@@ -34,7 +34,6 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/multifile.h"
@@ -43,15 +42,15 @@
 #include "client/client.h"
 #include "evaluation/scorer.h"
 #include "protocol/commands.pb.h"
+#include "absl/flags/flag.h"
 
 // Test data automatically generated by gen_client_quality_test_data.py
 // TestCase test_cases[] is defined.
 #include "client/client_quality_test_data.inc"
-#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, server_path, "", "specify server path");
-MOZC_FLAG(string, log_path, "", "specify log output file path");
-MOZC_FLAG(int32, max_case_for_source, 500,
+ABSL_FLAG(std::string, server_path, "", "specify server path");
+ABSL_FLAG(std::string, log_path, "", "specify log output file path");
+ABSL_FLAG(int32, max_case_for_source, 500,
           "specify max test case number for each test sources");
 
 namespace mozc {
@@ -203,8 +202,8 @@ int main(int argc, char* argv[]) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::client::Client client;
-  if (!mozc::GetFlag(FLAGS_server_path).empty()) {
-    client.set_server_program(mozc::GetFlag(FLAGS_server_path));
+  if (!absl::GetFlag(FLAGS_server_path).empty()) {
+    client.set_server_program(absl::GetFlag(FLAGS_server_path));
   }
 
   CHECK(client.IsValidRunLevel()) << "IsValidRunLevel failed";
@@ -222,7 +221,7 @@ int main(int argc, char* argv[]) {
     if (scores.find(source) == scores.end()) {
       scores[source] = std::vector<double>();
     }
-    if (scores[source].size() >= mozc::GetFlag(FLAGS_max_case_for_source)) {
+    if (scores[source].size() >= absl::GetFlag(FLAGS_max_case_for_source)) {
       continue;
     }
 
@@ -248,8 +247,8 @@ int main(int argc, char* argv[]) {
   }
 
   std::ostream* ofs = &std::cout;
-  if (!mozc::GetFlag(FLAGS_log_path).empty()) {
-    ofs = new mozc::OutputFileStream(mozc::GetFlag(FLAGS_log_path).c_str());
+  if (!absl::GetFlag(FLAGS_log_path).empty()) {
+    ofs = new mozc::OutputFileStream(absl::GetFlag(FLAGS_log_path).c_str());
   }
 
   // Average the scores
diff --git client/client_scenario_test_main.cc client/client_scenario_test_main.cc
index 584dbb985..acdb700fe 100644
--- client/client_scenario_test_main.cc
+++ client/client_scenario_test_main.cc
@@ -39,7 +39,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
@@ -54,13 +53,13 @@
 #include "absl/memory/memory.h"
 #include "absl/strings/match.h"
 
-MOZC_FLAG(string, input, "", "Input file");
-MOZC_FLAG(int32, key_duration, 10, "Key duration (msec)");
-MOZC_FLAG(string, profile_dir, "", "Profile dir");
-MOZC_FLAG(bool, sentence_mode, false, "Use input as sentences");
-MOZC_FLAG(string, server_path, "", "Specify server path");
-MOZC_FLAG(bool, test_renderer, false, "Test renderer");
-MOZC_FLAG(bool, test_testsendkey, true, "Test TestSendKey");
+ABSL_FLAG(std::string, input, "", "Input file");
+ABSL_FLAG(int32, key_duration, 10, "Key duration (msec)");
+ABSL_FLAG(std::string, profile_dir, "", "Profile dir");
+ABSL_FLAG(bool, sentence_mode, false, "Use input as sentences");
+ABSL_FLAG(std::string, server_path, "", "Specify server path");
+ABSL_FLAG(bool, test_renderer, false, "Test renderer");
+ABSL_FLAG(bool, test_testsendkey, true, "Test TestSendKey");
 
 namespace mozc {
 namespace {
@@ -97,8 +96,8 @@ bool ReadKeys(std::istream *input, std::vector<commands::KeyEvent> *keys,
 
 int Loop(std::istream *input) {
   mozc::client::Client client;
-  if (!mozc::GetFlag(FLAGS_server_path).empty()) {
-    client.set_server_program(mozc::GetFlag(FLAGS_server_path));
+  if (!absl::GetFlag(FLAGS_server_path).empty()) {
+    client.set_server_program(absl::GetFlag(FLAGS_server_path));
   }
 
   CHECK(client.IsValidRunLevel()) << "IsValidRunLevel failed";
@@ -108,7 +107,7 @@ int Loop(std::istream *input) {
   std::unique_ptr<mozc::renderer::RendererClient> renderer_client;
   mozc::commands::RendererCommand renderer_command;
 
-  if (mozc::GetFlag(FLAGS_test_renderer)) {
+  if (absl::GetFlag(FLAGS_test_renderer)) {
 #ifdef OS_WIN
     renderer_command.mutable_application_info()->set_process_id(
         ::GetCurrentProcessId());
@@ -139,9 +138,9 @@ int Loop(std::istream *input) {
   while (ReadKeys(input, &keys, &answer)) {
     CHECK(client.NoOperation()) << "Server is not responding";
     for (size_t i = 0; i < keys.size(); ++i) {
-      Util::Sleep(mozc::GetFlag(FLAGS_key_duration));
+      Util::Sleep(absl::GetFlag(FLAGS_key_duration));
 
-      if (mozc::GetFlag(FLAGS_test_testsendkey)) {
+      if (absl::GetFlag(FLAGS_test_testsendkey)) {
         VLOG(2) << "Sending to Server: " << keys[i].DebugString();
         client.TestSendKey(keys[i], &output);
         VLOG(2) << "Output of TestSendKey: " << output.DebugString();
@@ -175,20 +174,20 @@ int Loop(std::istream *input) {
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (!mozc::GetFlag(FLAGS_profile_dir).empty()) {
-    mozc::FileUtil::CreateDirectory(mozc::GetFlag(FLAGS_profile_dir));
-    mozc::SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_profile_dir));
+  if (!absl::GetFlag(FLAGS_profile_dir).empty()) {
+    mozc::FileUtil::CreateDirectory(absl::GetFlag(FLAGS_profile_dir));
+    mozc::SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_profile_dir));
   }
 
   std::unique_ptr<mozc::InputFileStream> input_file;
   std::istream *input = nullptr;
 
-  if (!mozc::GetFlag(FLAGS_input).empty()) {
+  if (!absl::GetFlag(FLAGS_input).empty()) {
     // Batch mode loading the input file.
     input_file = absl::make_unique<mozc::InputFileStream>(
-        mozc::GetFlag(FLAGS_input).c_str());
+        absl::GetFlag(FLAGS_input).c_str());
     if (input_file->fail()) {
-      LOG(ERROR) << "File not opened: " << mozc::GetFlag(FLAGS_input);
+      LOG(ERROR) << "File not opened: " << absl::GetFlag(FLAGS_input);
       return 1;
     }
     input = input_file.get();
diff --git client/client_stress_test_main.cc client/client_stress_test_main.cc
index a7e74c134..6b3d892a8 100644
--- client/client_stress_test_main.cc
+++ client/client_stress_test_main.cc
@@ -41,7 +41,6 @@
 #include <memory>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
@@ -55,21 +54,21 @@
 // 1. multi-thread testing
 // 2. change/config the senario
 
-MOZC_FLAG(int32, max_keyevents, 100000,
+ABSL_FLAG(int32, max_keyevents, 100000,
           "test at most |max_keyevents| key sequences");
-MOZC_FLAG(string, server_path, "", "specify server path");
-MOZC_FLAG(int32, key_duration, 10, "key duration (msec)");
-MOZC_FLAG(bool, test_renderer, false, "test renderer");
-MOZC_FLAG(bool, test_testsendkey, true, "test TestSendKey");
+ABSL_FLAG(std::string, server_path, "", "specify server path");
+ABSL_FLAG(int32, key_duration, 10, "key duration (msec)");
+ABSL_FLAG(bool, test_renderer, false, "test renderer");
+ABSL_FLAG(bool, test_testsendkey, true, "test TestSendKey");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  mozc::SetFlag(&FLAGS_logtostderr, true);
+  absl::SetFlag(&FLAGS_logtostderr, true);
 
   mozc::client::Client client;
-  if (!mozc::GetFlag(FLAGS_server_path).empty()) {
-    client.set_server_program(mozc::GetFlag(FLAGS_server_path));
+  if (!absl::GetFlag(FLAGS_server_path).empty()) {
+    client.set_server_program(absl::GetFlag(FLAGS_server_path));
   }
 
   CHECK(client.IsValidRunLevel()) << "IsValidRunLevel failed";
@@ -79,7 +78,7 @@ int main(int argc, char **argv) {
   std::unique_ptr<mozc::renderer::RendererClient> renderer_client;
   mozc::commands::RendererCommand renderer_command;
 
-  if (mozc::GetFlag(FLAGS_test_renderer)) {
+  if (absl::GetFlag(FLAGS_test_renderer)) {
 #ifdef OS_WIN
     renderer_command.mutable_application_info()->set_process_id(
         ::GetCurrentProcessId());
@@ -111,17 +110,17 @@ int main(int argc, char **argv) {
     mozc::session::RandomKeyEventsGenerator::GenerateSequence(&keys);
     CHECK(client.NoOperation()) << "Server is not responding";
     for (size_t i = 0; i < keys.size(); ++i) {
-      mozc::Util::Sleep(mozc::GetFlag(FLAGS_key_duration));
+      mozc::Util::Sleep(absl::GetFlag(FLAGS_key_duration));
       keyevents_size++;
       if (keyevents_size % 100 == 0) {
         std::cout << keyevents_size << " key events finished" << std::endl;
       }
-      if (mozc::GetFlag(FLAGS_max_keyevents) < keyevents_size) {
+      if (absl::GetFlag(FLAGS_max_keyevents) < keyevents_size) {
         std::cout << "key events reached to "
-                  << mozc::GetFlag(FLAGS_max_keyevents) << std::endl;
+                  << absl::GetFlag(FLAGS_max_keyevents) << std::endl;
         return 0;
       }
-      if (mozc::GetFlag(FLAGS_test_testsendkey)) {
+      if (absl::GetFlag(FLAGS_test_testsendkey)) {
         VLOG(2) << "Sending to Server: " << keys[i].DebugString();
         client.TestSendKey(keys[i], &output);
         VLOG(2) << "Output of TestSendKey: " << output.DebugString();
diff --git client/ping_server_main.cc client/ping_server_main.cc
index 879191b73..261a2daf6 100644
--- client/ping_server_main.cc
+++ client/ping_server_main.cc
@@ -29,10 +29,10 @@
 
 #include <iostream>  // NOLINT
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "client/client.h"
+#include "absl/flags/flag.h"
 
 // Simple command line tool to ping mozc server
 int main(int argc, char **argv) {
diff --git client/server_launcher.cc client/server_launcher.cc
index 24e37cd8c..c201c5d0a 100644
--- client/server_launcher.cc
+++ client/server_launcher.cc
@@ -132,7 +132,7 @@ bool ServerLauncher::StartServer(ClientInterface *client) {
 #endif
 
 #ifdef DEBUG
-  // In oreder to test the Session treatment (timeout/size constratins),
+  // In order to test the Session treatment (timeout/size constratins),
   // Server flags can be configurable on DEBUG build
   if (!arg.empty()) {
     arg += " ";
diff --git client/server_launcher_main.cc client/server_launcher_main.cc
index 67e045bf7..f3381f500 100644
--- client/server_launcher_main.cc
+++ client/server_launcher_main.cc
@@ -29,20 +29,19 @@
 
 #include <iostream>  // NOLINT
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "client/client.h"
 #include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, shutdown, false, "shutdown server if mozc_server is running");
+ABSL_FLAG(bool, shutdown, false, "shutdown server if mozc_server is running");
 
 // simple command line tool to launch mozc server
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
   mozc::client::Client client;
 
-  if (mozc::GetFlag(FLAGS_shutdown)) {
+  if (absl::GetFlag(FLAGS_shutdown)) {
     client.Shutdown();
   }
 
diff --git composer/BUILD composer/BUILD
index c3a74b721..7d27f0780 100644
--- composer/BUILD
+++ composer/BUILD
@@ -49,7 +49,6 @@ cc_library_mozc(
         ":table",
         ":type_corrected_query",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:util",
@@ -66,6 +65,7 @@ cc_library_mozc(
         "//protocol:config_proto",
         "//testing:gunit_prod",
         "//transliteration",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -145,12 +145,12 @@ cc_binary_mozc(
         ":composition_interface",
         ":table",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base/protobuf",
         "//protocol:commands_proto",
         "//protocol:config_proto",
         "//transliteration",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git composer/composer.cc composer/composer.cc
index 5c8beb304..077874526 100644
--- composer/composer.cc
+++ composer/composer.cc
@@ -31,7 +31,6 @@
 
 #include "composer/composer.h"
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "composer/internal/composition.h"
@@ -46,11 +45,12 @@
 #include "config/config_handler.h"
 #include "protocol/commands.pb.h"
 #include "protocol/config.pb.h"
+#include "absl/flags/flag.h"
 
 // Use flags instead of constant for performance evaluation.
-MOZC_FLAG(uint64, max_typing_correction_query_candidates, 40,
+ABSL_FLAG(uint64, max_typing_correction_query_candidates, 40,
           "Maximum # of typing correction query temporary candidates.");
-MOZC_FLAG(uint64, max_typing_correction_query_results, 8,
+ABSL_FLAG(uint64, max_typing_correction_query_results, 8,
           "Maximum # of typing correction query results.");
 
 namespace mozc {
@@ -208,8 +208,8 @@ Composer::Composer(const Table *table, const commands::Request *request,
       shifted_sequence_count_(0),
       composition_(new Composition(table)),
       typing_corrector_(
-          table, mozc::GetFlag(FLAGS_max_typing_correction_query_candidates),
-          mozc::GetFlag(FLAGS_max_typing_correction_query_results)),
+          table, absl::GetFlag(FLAGS_max_typing_correction_query_candidates),
+          absl::GetFlag(FLAGS_max_typing_correction_query_results)),
       max_length_(kMaxPreeditLength),
       request_(request),
       config_(config) {
diff --git composer/composer_main.cc composer/composer_main.cc
index 51acd415b..d98cfbe0f 100644
--- composer/composer_main.cc
+++ composer/composer_main.cc
@@ -31,7 +31,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "composer/composer.h"
 #include "composer/composition_interface.h"
@@ -39,8 +38,9 @@
 #include "protocol/commands.pb.h"
 #include "protocol/config.pb.h"
 #include "transliteration/transliteration.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, table, "system://romanji-hiragana.tsv",
+ABSL_FLAG(std::string, table, "system://romanji-hiragana.tsv",
           "preedit conversion table file.");
 
 using ::mozc::commands::Request;
@@ -50,7 +50,7 @@ int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::composer::Table table;
-  table.LoadFromFile(mozc::GetFlag(FLAGS_table).c_str());
+  table.LoadFromFile(absl::GetFlag(FLAGS_table).c_str());
   std::unique_ptr<mozc::composer::Composer> composer(
       new mozc::composer::Composer(&table, &Request::default_instance(),
                                    &Config::default_instance()));
diff --git composer/composer_test.cc composer/composer_test.cc
index c589c542d..2d365a469 100644
--- composer/composer_test.cc
+++ composer/composer_test.cc
@@ -2514,7 +2514,7 @@ TEST_F(ComposerTest, InputModesChangeWhenCursorMoves) {
   }
 }
 
-TEST_F(ComposerTest, ShuoldCommit) {
+TEST_F(ComposerTest, ShouldCommit) {
   table_->AddRuleWithAttributes("ka", "[KA]", "", DIRECT_INPUT);
   table_->AddRuleWithAttributes("tt", "[X]", "t", DIRECT_INPUT);
   table_->AddRuleWithAttributes("ta", "[TA]", "", NO_TABLE_ATTRIBUTE);
diff --git composer/internal/BUILD composer/internal/BUILD
index 9ca7887c5..66f0b7130 100644
--- composer/internal/BUILD
+++ composer/internal/BUILD
@@ -184,10 +184,10 @@ cc_binary_mozc(
     srcs = ["composition_main.cc"],
     deps = [
         ":composition",
-        "//base:flags",
         "//base:init_mozc",
         "//composer:composition_interface",
         "//composer:table",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -243,9 +243,9 @@ cc_binary_mozc(
     srcs = ["converter_main.cc"],
     deps = [
         ":converter",
-        "//base:flags",
         "//base:init_mozc",
         "//composer:table",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -301,7 +301,6 @@ cc_library_mozc(
         ":composition_input",
         ":typing_model",
         "//base",
-        "//base:flags",
         "//base:port",
         "//base/protobuf",
         "//base/protobuf:repeated_field",
@@ -310,6 +309,7 @@ cc_library_mozc(
         "//composer:type_corrected_query",
         "//config:config_handler",
         "//protocol:config_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git composer/internal/char_chunk_test.cc composer/internal/char_chunk_test.cc
index 9b8c9243c..12dac3eda 100644
--- composer/internal/char_chunk_test.cc
+++ composer/internal/char_chunk_test.cc
@@ -1026,7 +1026,7 @@ TEST(CharChunkTest, Combine) {
     EXPECT_EQ("LRRR", rhs.raw());
   }
 
-  {  // lhs' ambigous is empty.
+  {  // lhs' ambiguous is empty.
     CharChunk lhs(Transliterators::CONVERSION_STRING, nullptr);
     CharChunk rhs(Transliterators::CONVERSION_STRING, nullptr);
 
@@ -1047,7 +1047,7 @@ TEST(CharChunkTest, Combine) {
     EXPECT_EQ("LRRR", rhs.raw());
   }
 
-  {  // rhs' ambigous is empty.
+  {  // rhs' ambiguous is empty.
     CharChunk lhs(Transliterators::CONVERSION_STRING, nullptr);
     CharChunk rhs(Transliterators::CONVERSION_STRING, nullptr);
 
diff --git composer/internal/composition_main.cc composer/internal/composition_main.cc
index 82e63fe84..0fec00464 100644
--- composer/internal/composition_main.cc
+++ composer/internal/composition_main.cc
@@ -30,19 +30,19 @@
 #include <iostream>  // NOLINT
 #include <sstream>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "composer/internal/composition.h"
 #include "composer/table.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, table, "system://romanji-hiragana.tsv",
+ABSL_FLAG(std::string, table, "system://romanji-hiragana.tsv",
           "preedit conversion table file.");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::composer::Table table;
-  table.LoadFromFile(mozc::GetFlag(FLAGS_table).c_str());
+  table.LoadFromFile(absl::GetFlag(FLAGS_table).c_str());
 
   mozc::composer::Composition composition(&table);
 
diff --git composer/internal/converter_main.cc composer/internal/converter_main.cc
index 2c92d0d31..c091f50dd 100644
--- composer/internal/converter_main.cc
+++ composer/internal/converter_main.cc
@@ -30,19 +30,19 @@
 #include <iostream>  // NOLINT
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "composer/internal/converter.h"
 #include "composer/table.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, table, "system://romanji-hiragana.tsv",
+ABSL_FLAG(std::string, table, "system://romanji-hiragana.tsv",
           "preedit conversion table file.");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::composer::Table table;
-  table.LoadFromFile(mozc::GetFlag(FLAGS_table).c_str());
+  table.LoadFromFile(absl::GetFlag(FLAGS_table).c_str());
 
   mozc::composer::Converter converter(table);
 
diff --git composer/internal/transliterator_interface.h composer/internal/transliterator_interface.h
index d335b422e..e112761d4 100644
--- composer/internal/transliterator_interface.h
+++ composer/internal/transliterator_interface.h
@@ -52,7 +52,7 @@ class TransliteratorInterface {
   // Split raw and converted strings based on the transliteration
   // rule.  If raw or converted could not be deterministically split,
   // fall back strings are fill and false is returned.  The first
-  // arugment, position, is in character (rather than byte).
+  // argument, position, is in character (rather than byte).
   //
   // Expected usage examples:
   // - HiraganaTransliterator(1, "kk", "っk") => true
diff --git composer/internal/transliterators.cc composer/internal/transliterators.cc
index 1f7e52dbb..c57dc3cb0 100644
--- composer/internal/transliterators.cc
+++ composer/internal/transliterators.cc
@@ -90,7 +90,7 @@ class ConversionStringSelector : public TransliteratorInterface {
     return converted;
   }
 
-  // NOTE(komatsu): The first argument, size_t postion, should not be
+  // NOTE(komatsu): The first argument, size_t position, should not be
   // const because this function overrides the virtual function of
   // TransliterateInterface whose first argument is not const.
   // Otherwise the Windows compiler (cl.exe) raises an error.
diff --git composer/internal/transliterators.h composer/internal/transliterators.h
index 650056a4e..e74e3d6ea 100644
--- composer/internal/transliterators.h
+++ composer/internal/transliterators.h
@@ -55,7 +55,7 @@ class Transliterators {
     // Returns half ascii.
     HALF_ASCII,
     // Special transliterator.
-    // Use locally asigned transliterator.
+    // Use locally assigned transliterator.
     // Many methods don't accept this value.
     LOCAL,
 
diff --git composer/internal/typing_corrector.cc composer/internal/typing_corrector.cc
index da444d9ff..e15b3c041 100644
--- composer/internal/typing_corrector.cc
+++ composer/internal/typing_corrector.cc
@@ -35,7 +35,6 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/port.h"
 #include "composer/internal/composition.h"
 #include "composer/internal/composition_input.h"
@@ -44,6 +43,7 @@
 #include "composer/type_corrected_query.h"
 #include "config/config_handler.h"
 #include "protocol/config.pb.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
 namespace mozc {
diff --git composer/key_parser_test.cc composer/key_parser_test.cc
index 200a4bb67..68cfa0034 100644
--- composer/key_parser_test.cc
+++ composer/key_parser_test.cc
@@ -125,7 +125,7 @@ TEST(KeyParserTest, SpecialKeys) {
       std::make_pair("home", commands::KeyEvent::HOME),
       std::make_pair("end", commands::KeyEvent::END),
       std::make_pair("space", commands::KeyEvent::SPACE),
-      std::make_pair("ascii", commands::KeyEvent::TEXT_INPUT),  // depricated
+      std::make_pair("ascii", commands::KeyEvent::TEXT_INPUT),  // deprecated
       std::make_pair("textinput", commands::KeyEvent::TEXT_INPUT),
       std::make_pair("tab", commands::KeyEvent::TAB),
       std::make_pair("pageup", commands::KeyEvent::PAGE_UP),
diff --git config/BUILD config/BUILD
index 35e49e053..aaa40f119 100644
--- config/BUILD
+++ config/BUILD
@@ -67,7 +67,6 @@ cc_test_mozc(
         ":config_handler",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:mozc_hash_set",
         "//base:port",
@@ -77,6 +76,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//testing:gunit_main",
         "//testing:mozctest",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -108,12 +108,12 @@ cc_test_mozc(
         ":config_handler",
         ":stats_config_util",
         "//base:file_util",
-        "//base:flags",
         "//base:singleton",
         "//base:system_util",
         "//base:win_api_test_helper",
         "//protocol:config_proto",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -152,9 +152,9 @@ cc_test_mozc(
         ":character_form_manager",
         ":config_handler",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//protocol:config_proto",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
diff --git config/character_form_manager.h config/character_form_manager.h
index 65b3528af..36ae66092 100644
--- config/character_form_manager.h
+++ config/character_form_manager.h
@@ -130,7 +130,7 @@ class CharacterFormManager {
   //  form1=Half form2=Full
   //
   // If input1 and input2 have mixed form types and the result
-  // is ambigous, this function returns false.
+  // is ambiguous, this function returns false.
   //
   // Ambiguous case:
   //  input1="ABC123" input2="ABC123"
diff --git config/character_form_manager_test.cc config/character_form_manager_test.cc
index 8e055f30d..d0ef380f2 100644
--- config/character_form_manager_test.cc
+++ config/character_form_manager_test.cc
@@ -31,12 +31,12 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "protocol/config.pb.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace config {
@@ -45,7 +45,7 @@ class CharacterFormManagerTest : public ::testing::Test {
  public:
   void SetUp() override {
     // set default user profile directory
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     CharacterFormManager *manager =
         CharacterFormManager::GetCharacterFormManager();
     manager->SetDefaultRule();
diff --git config/config_handler.cc config/config_handler.cc
index de8d56ae8..71e01b20d 100644
--- config/config_handler.cc
+++ config/config_handler.cc
@@ -131,7 +131,7 @@ bool ConfigHandlerImpl::GetStoredConfig(Config *config) const {
   return true;
 }
 
-// set config and rewirte internal data
+// set config and rewrite internal data
 bool ConfigHandlerImpl::SetConfigInternal(const Config &config) {
   stored_config_.CopyFrom(config);
 
diff --git config/config_handler_test.cc config/config_handler_test.cc
index 01584d6c2..43dd9a5a8 100644
--- config/config_handler_test.cc
+++ config/config_handler_test.cc
@@ -37,7 +37,6 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/mozc_hash_set.h"
 #include "base/port.h"
@@ -48,6 +47,7 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/mozctest.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -57,7 +57,7 @@ namespace {
 class ConfigHandlerTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     default_config_filename_ = ConfigHandler::GetConfigFileName();
     Config default_config;
     ConfigHandler::GetDefaultConfig(&default_config);
@@ -97,7 +97,7 @@ TEST_F(ConfigHandlerTest, SetConfig) {
   Config output;
 
   const std::string config_file = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "mozc_config_test_tmp");
+      absl::GetFlag(FLAGS_test_tmpdir), "mozc_config_test_tmp");
   FileUtil::Unlink(config_file);
   ScopedSetConfigFileName scoped_config_file_name(config_file);
   EXPECT_EQ(config_file, ConfigHandler::GetConfigFileName());
@@ -157,7 +157,7 @@ TEST_F(ConfigHandlerTest, SetImposedConfig) {
   Config output;
 
   const std::string config_file = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "mozc_config_test_tmp");
+      absl::GetFlag(FLAGS_test_tmpdir), "mozc_config_test_tmp");
   FileUtil::Unlink(config_file);
   ScopedSetConfigFileName scoped_config_file_name(config_file);
   ASSERT_TRUE(ConfigHandler::Reload())
@@ -232,7 +232,7 @@ TEST_F(ConfigHandlerTest, ConfigFileNameConfig) {
       std::string("config") + std::to_string(config::CONFIG_VERSION);
 
   const std::string filename =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), config_file);
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), config_file);
   FileUtil::Unlink(filename);
   Config input;
   ConfigHandler::SetConfig(input);
diff --git config/stats_config_util_test.cc config/stats_config_util_test.cc
index 4efe077c7..1dd968409 100644
--- config/stats_config_util_test.cc
+++ config/stats_config_util_test.cc
@@ -33,12 +33,12 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/singleton.h"
 #include "base/system_util.h"
 #include "base/win_api_test_helper.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 #ifdef OS_ANDROID
 #include "config/config_handler.h"
@@ -672,7 +672,7 @@ TEST(StatsConfigUtilTestWin, IsEnabled) {
 #ifdef OS_ANDROID
 TEST(StatsConfigUtilTestAndroid, DefaultValueTest) {
   const string config_file = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "mozc_stats_config_util_test_tmp");
+      absl::GetFlag(FLAGS_test_tmpdir), "mozc_stats_config_util_test_tmp");
   FileUtil::Unlink(config_file);
   ConfigHandler::SetConfigFileName(config_file);
   EXPECT_EQ(config_file, ConfigHandler::GetConfigFileName());
diff --git converter/BUILD converter/BUILD
index 76c50e178..67c9e4ca2 100644
--- converter/BUILD
+++ converter/BUILD
@@ -596,9 +596,9 @@ cc_test_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//testing:gunit_main",
         "//testing:mozctest",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -625,7 +625,6 @@ cc_binary_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:number_util",
@@ -641,6 +640,7 @@ cc_binary_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//session:request_test_util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -788,11 +788,11 @@ cc_binary_mozc(
     deps = [
         ":quality_regression_util",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base:util",
         "//engine:engine_factory",
         "//engine:engine_interface",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git converter/candidate_filter.cc converter/candidate_filter.cc
index a0543a08c..0033766b2 100644
--- converter/candidate_filter.cc
+++ converter/candidate_filter.cc
@@ -65,7 +65,7 @@ const size_t kMaxCandidatesSize = 200;  // how many candidates we expand
 // cost(B) - cost(A) = -500 * [log(prob(B)) - log (C * prob(B)) ]
 //                   = -500 * [-log(C) + log(prob(B)) - log(prob(B))]
 //                   = 500 * log(C)
-// This implies that it is more reasonable to filter candiates
+// This implies that it is more reasonable to filter candidates
 // by an absolute difference of costs between cost(B) and cost(A).
 //
 // Here's "C" and cost-diff relation:
diff --git converter/candidate_filter_test.cc converter/candidate_filter_test.cc
index f99174d49..9fbb6aa40 100644
--- converter/candidate_filter_test.cc
+++ converter/candidate_filter_test.cc
@@ -173,7 +173,7 @@ TEST_F(CandidateFilterTest, FilterTest) {
     filter->Reset();
   }
 
-  // Check if a canidate is active before appending many candidates.
+  // Check if a candidate is active before appending many candidates.
   Segment::Candidate *c4 = NewCandidate();
   for (size_t i = 0; i < arraysize(kRequestTypes); ++i) {
     EXPECT_EQ(CandidateFilter::GOOD_CANDIDATE,
diff --git converter/converter_interface.h converter/converter_interface.h
index 12074f946..2553fc2b2 100644
--- converter/converter_interface.h
+++ converter/converter_interface.h
@@ -159,7 +159,7 @@ class ConverterInterface {
       Segments *segments, const std::vector<size_t> &candidate_index) const = 0;
 
   // Resize segment_index-th segment by offset_length.
-  // offset_lenth can be negative.
+  // offset_length can be negative.
   virtual bool ResizeSegment(Segments *segments,
                              const ConversionRequest &request,
                              size_t segment_index, int offset_length) const = 0;
diff --git converter/converter_main.cc converter/converter_main.cc
index 0f513914b..b9e745a01 100644
--- converter/converter_main.cc
+++ converter/converter_main.cc
@@ -36,7 +36,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/number_util.h"
@@ -56,24 +55,25 @@
 #include "protocol/config.pb.h"
 #include "request/conversion_request.h"
 #include "session/request_test_util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(int32, max_conversion_candidates_size, 200,
+ABSL_FLAG(int32, max_conversion_candidates_size, 200,
           "maximum candidates size");
-MOZC_FLAG(string, user_profile_dir, "", "path to user profile directory");
-MOZC_FLAG(string, engine_name, "default",
+ABSL_FLAG(std::string, user_profile_dir, "", "path to user profile directory");
+ABSL_FLAG(std::string, engine_name, "default",
           "Shortcut to select engine_data_path from name: (default|oss|mock)");
-MOZC_FLAG(string, engine_type, "desktop", "Engine type: (desktop|mobile)");
-MOZC_FLAG(bool, output_debug_string, true,
+ABSL_FLAG(std::string, engine_type, "desktop", "Engine type: (desktop|mobile)");
+ABSL_FLAG(bool, output_debug_string, true,
           "output debug string for each input");
-MOZC_FLAG(bool, show_meta_candidates, false, "if true, show meta candidates");
+ABSL_FLAG(bool, show_meta_candidates, false, "if true, show meta candidates");
 
 // Advanced options for data files.  These are automatically set when --engine
 // is used but they can be overridden by specifying these flags.
-MOZC_FLAG(string, engine_data_path, "",
+ABSL_FLAG(std::string, engine_data_path, "",
           "Path to engine data file. This overrides the default data path "
           "for engine_name.");
-MOZC_FLAG(string, magic, "", "Expected magic number of data file");
-MOZC_FLAG(string, id_def, "",
+ABSL_FLAG(std::string, magic, "", "Expected magic number of data file");
+ABSL_FLAG(std::string, id_def, "",
           "id.def file for POS IDs. If provided, show human readable "
           "POS instead of ID number");
 
@@ -93,7 +93,7 @@ class PosIdPrintUtil {
 
  private:
   PosIdPrintUtil()
-      : pos_id_(new InputFileStream(mozc::GetFlag(FLAGS_id_def).c_str())),
+      : pos_id_(new InputFileStream(absl::GetFlag(FLAGS_id_def).c_str())),
         pos_id_printer_(new internal::PosIdPrinter(pos_id_.get())) {}
 
   std::string IdToStringInternal(int id) const {
@@ -238,7 +238,7 @@ void PrintSegment(size_t num, size_t segments_size, const Segment &segment,
         << SegmentTypeToString(segment.segment_type()) << "] ----------"
         << std::endl
         << segment.key() << std::endl;
-  if (mozc::GetFlag(FLAGS_show_meta_candidates)) {
+  if (absl::GetFlag(FLAGS_show_meta_candidates)) {
     for (int i = 0; i < segment.meta_candidates_size(); ++i) {
       PrintCandidate(segment, -i - 1, segment.meta_candidate(i), os);
     }
@@ -271,7 +271,7 @@ bool ExecCommand(const ConverterInterface &converter, Segments *segments,
   const Config config;
 
   segments->set_max_conversion_candidates_size(
-      mozc::GetFlag(FLAGS_max_conversion_candidates_size));
+      absl::GetFlag(FLAGS_max_conversion_candidates_size));
 
   if (func == "startconversion" || func == "start" || func == "s") {
     CHECK_FIELDS_LENGTH(2);
@@ -441,56 +441,56 @@ bool IsConsistentEngineNameAndType(const std::string &engine_name,
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (!mozc::GetFlag(FLAGS_user_profile_dir).empty()) {
+  if (!absl::GetFlag(FLAGS_user_profile_dir).empty()) {
     mozc::SystemUtil::SetUserProfileDirectory(
-        mozc::GetFlag(FLAGS_user_profile_dir));
+        absl::GetFlag(FLAGS_user_profile_dir));
   }
 
   std::string mozc_runfiles_dir = ".";
-  if (mozc::GetFlag(FLAGS_engine_data_path).empty()) {
+  if (absl::GetFlag(FLAGS_engine_data_path).empty()) {
     const auto path_and_magic = mozc::SelectDataFileFromName(
-        mozc_runfiles_dir, mozc::GetFlag(FLAGS_engine_name));
-    mozc::SetFlag(&FLAGS_engine_data_path, path_and_magic.first);
-    mozc::SetFlag(&FLAGS_magic, path_and_magic.second);
+        mozc_runfiles_dir, absl::GetFlag(FLAGS_engine_name));
+    absl::SetFlag(&FLAGS_engine_data_path, path_and_magic.first);
+    absl::SetFlag(&FLAGS_magic, path_and_magic.second);
   }
-  CHECK(!mozc::GetFlag(FLAGS_engine_data_path).empty())
+  CHECK(!absl::GetFlag(FLAGS_engine_data_path).empty())
       << "--engine_data_path or --engine is invalid: "
-      << "--engine_data_path=" << mozc::GetFlag(FLAGS_engine_data_path) << " "
-      << "--engine_name=" << mozc::GetFlag(FLAGS_engine_name);
+      << "--engine_data_path=" << absl::GetFlag(FLAGS_engine_data_path) << " "
+      << "--engine_name=" << absl::GetFlag(FLAGS_engine_name);
 
-  if (mozc::GetFlag(FLAGS_id_def).empty()) {
-    mozc::SetFlag(&FLAGS_id_def,
+  if (absl::GetFlag(FLAGS_id_def).empty()) {
+    absl::SetFlag(&FLAGS_id_def,
                   mozc::SelectIdDefFromName(mozc_runfiles_dir,
-                                            mozc::GetFlag(FLAGS_engine_name)));
+                                            absl::GetFlag(FLAGS_engine_name)));
   }
 
-  std::cout << "Engine type: " << mozc::GetFlag(FLAGS_engine_type)
-            << "\nData file: " << mozc::GetFlag(FLAGS_engine_data_path)
-            << "\nid.def: " << mozc::GetFlag(FLAGS_id_def) << std::endl;
+  std::cout << "Engine type: " << absl::GetFlag(FLAGS_engine_type)
+            << "\nData file: " << absl::GetFlag(FLAGS_engine_data_path)
+            << "\nid.def: " << absl::GetFlag(FLAGS_id_def) << std::endl;
 
   std::unique_ptr<mozc::DataManager> data_manager(new mozc::DataManager);
   const auto status = data_manager->InitFromFile(
-      mozc::GetFlag(FLAGS_engine_data_path), mozc::GetFlag(FLAGS_magic));
+      absl::GetFlag(FLAGS_engine_data_path), absl::GetFlag(FLAGS_magic));
   CHECK_EQ(status, mozc::DataManager::Status::OK);
 
   mozc::commands::Request request;
   std::unique_ptr<mozc::EngineInterface> engine;
-  if (mozc::GetFlag(FLAGS_engine_type) == "desktop") {
+  if (absl::GetFlag(FLAGS_engine_type) == "desktop") {
     engine = mozc::Engine::CreateDesktopEngine(std::move(data_manager)).value();
-  } else if (mozc::GetFlag(FLAGS_engine_type) == "mobile") {
+  } else if (absl::GetFlag(FLAGS_engine_type) == "mobile") {
     engine = mozc::Engine::CreateMobileEngine(std::move(data_manager)).value();
     mozc::commands::RequestForUnitTest::FillMobileRequest(&request);
   } else {
     LOG(FATAL) << "Invalid type: --engine_type="
-               << mozc::GetFlag(FLAGS_engine_type);
+               << absl::GetFlag(FLAGS_engine_type);
     return 0;
   }
 
   mozc::ConverterInterface *converter = engine->GetConverter();
   CHECK(converter);
 
-  if (!mozc::IsConsistentEngineNameAndType(mozc::GetFlag(FLAGS_engine_name),
-                                           mozc::GetFlag(FLAGS_engine_type))) {
+  if (!mozc::IsConsistentEngineNameAndType(absl::GetFlag(FLAGS_engine_name),
+                                           absl::GetFlag(FLAGS_engine_type))) {
     LOG(WARNING) << "Engine name and type do not match.";
   }
 
@@ -499,7 +499,7 @@ int main(int argc, char **argv) {
 
   while (!std::getline(std::cin, line).fail()) {
     if (mozc::ExecCommand(*converter, &segments, line, request)) {
-      if (mozc::GetFlag(FLAGS_output_debug_string)) {
+      if (absl::GetFlag(FLAGS_output_debug_string)) {
         mozc::PrintSegments(segments, &std::cout);
       }
     } else {
diff --git converter/converter_test.cc converter/converter_test.cc
index e4b63f55a..2617035e0 100644
--- converter/converter_test.cc
+++ converter/converter_test.cc
@@ -836,7 +836,7 @@ TEST_F(ConverterTest, Regression3437022) {
   const std::string kValue2 = "電話";
 
   {
-    // Make sure converte result is one segment
+    // Make sure convert result is one segment
     EXPECT_TRUE(converter->StartConversion(&segments, kKey1 + kKey2));
     EXPECT_EQ(1, segments.conversion_segments_size());
     EXPECT_EQ(kValue1 + kValue2,
diff --git converter/gen_segmenter_bitarray.cc converter/gen_segmenter_bitarray.cc
index 6de0d6c43..f055857c6 100644
--- converter/gen_segmenter_bitarray.cc
+++ converter/gen_segmenter_bitarray.cc
@@ -55,7 +55,7 @@ class StateTable {
     idarray_.resize(size);
   }
 
-  // |str| is an 1-dimentional row (or column) represented in byte array.
+  // |str| is an 1-dimensional row (or column) represented in byte array.
   void Add(uint16 id, absl::string_view str) {
     CHECK_LT(id, idarray_.size());
 #ifdef ABSL_USES_STD_STRING_VIEW
diff --git converter/immutable_converter.cc converter/immutable_converter.cc
index 72b17bc47..9cdd92fe3 100644
--- converter/immutable_converter.cc
+++ converter/immutable_converter.cc
@@ -332,14 +332,14 @@ void ImmutableConverterImpl::InsertDummyCandidates(Segment *segment,
           ? nullptr
           : segment->mutable_candidate(segment->candidates_size() - 1);
 
-  // Insert a dummy candiate whose content_value is katakana.
+  // Insert a dummy candidate whose content_value is katakana.
   // If functional_key() is empty, no need to make a dummy candidate.
   if (segment->candidates_size() > 0 &&
       segment->candidates_size() < expand_size &&
       !segment->candidate(0).functional_key().empty() &&
       Util::GetScriptType(segment->candidate(0).content_key) ==
           Util::HIRAGANA) {
-    // Use last_candidate as a refernce of cost.
+    // Use last_candidate as a reference of cost.
     // Use top_candidate as a refarence of lid/rid and key/value.
     DCHECK(top_candidate);
     DCHECK(last_candidate);
@@ -469,7 +469,7 @@ bool ImmutableConverterImpl::ResegmentArabicNumberAndSuffix(
         continue;
       }
 
-      // not compatibile
+      // not compatible
       if (number_value != number_key) {
         LOG(WARNING) << "Incompatible key/value number pair";
         continue;
@@ -545,7 +545,7 @@ bool ImmutableConverterImpl::ResegmentPrefixAndArabicNumber(
         continue;
       }
 
-      // not compatibile
+      // not compatible
       if (number_value != number_key) {
         LOG(WARNING) << "Incompatible key/value number pair";
         continue;
diff --git converter/immutable_converter_interface.h converter/immutable_converter_interface.h
index ac34db102..b116d092e 100644
--- converter/immutable_converter_interface.h
+++ converter/immutable_converter_interface.h
@@ -48,7 +48,7 @@ class ImmutableConverterInterface {
   virtual bool Convert(Segments *segments) const;
 
   // This method should be pure-virtual method in theory.
-  // However, to keep the backward compatibility untill the deprecation of
+  // However, to keep the backward compatibility until the deprecation of
   // Conversion method, we provide the default implementation.
   // Please see the .cc file.
   virtual bool ConvertForRequest(const ConversionRequest &request,
diff --git converter/key_corrector.cc converter/key_corrector.cc
index dc6574b2c..0eaa94a1f 100644
--- converter/key_corrector.cc
+++ converter/key_corrector.cc
@@ -452,7 +452,7 @@ bool KeyCorrector::CorrectKey(const std::string &key, InputMode mode,
         rev_alignment_.push_back(len + i);
       }
     } else {
-      // NOT a one to one maping, we take fist/last alignment only
+      // NOT a one to one mapping, we take fist/last alignment only
       alignment_.push_back(org_len);
       for (size_t i = 1; i < mblen; ++i) {
         alignment_.push_back(kInvalidPos);
diff --git converter/lattice.h converter/lattice.h
index 3d92b1f47..269d55237 100644
--- converter/lattice.h
+++ converter/lattice.h
@@ -48,7 +48,7 @@ class Lattice {
 
   NodeAllocator *node_allocator() const;
 
-  // set key and initalizes lattice with key.
+  // set key and initializes lattice with key.
   void SetKey(absl::string_view key);
 
   // return key.
diff --git converter/nbest_generator.cc converter/nbest_generator.cc
index 8d1f56bbd..6014eb3b4 100644
--- converter/nbest_generator.cc
+++ converter/nbest_generator.cc
@@ -289,7 +289,7 @@ bool NBestGenerator::Next(const std::string &original_key,
   //
   // Example:
   // |left_node| => |node1| => |node2| => |node3| => |right_node|.
-  // |node1| .. |node2| consists of a candidate.
+  // |node1| .. |node3| consists of a candidate.
   //
   // cost = (left_node->cost - begin_node_->cost) +
   //        trans(left_node, node1) + node1->wcost +
@@ -313,7 +313,7 @@ bool NBestGenerator::Next(const std::string &original_key,
   // Insert Viterbi best result here to make sure that
   // the top result is Viterbi best result.
   if (!viterbi_result_checked_) {
-    // Use CandiadteFilter so that filter is initialized with the
+    // Use CandidateFilter so that filter is initialized with the
     // Viterbi-best path.
     switch (InsertTopResult(original_key, candidate, request_type)) {
       case CandidateFilter::GOOD_CANDIDATE:
@@ -495,7 +495,7 @@ NBestGenerator::BoundaryCheckResult NBestGenerator::CheckOnlyMid(
     return VALID;
   }
 
-  // is_boundary is true if there is a grammer-based boundary
+  // is_boundary is true if there is a grammar-based boundary
   // between lnode and rnode
   const bool is_boundary = (lnode->node_type == Node::HIS_NODE ||
                             segmenter_->IsBoundary(*lnode, *rnode, false));
@@ -521,7 +521,7 @@ NBestGenerator::BoundaryCheckResult NBestGenerator::CheckOnlyEdge(
     return VALID;
   }
 
-  // is_boundary is true if there is a grammer-based boundary
+  // is_boundary is true if there is a grammar-based boundary
   // between lnode and rnode
   const bool is_boundary = (lnode->node_type == Node::HIS_NODE ||
                             segmenter_->IsBoundary(*lnode, *rnode, true));
@@ -542,7 +542,7 @@ NBestGenerator::BoundaryCheckResult NBestGenerator::CheckStrict(
     return VALID;
   }
 
-  // is_boundary is true if there is a grammer-based boundary
+  // is_boundary is true if there is a grammar-based boundary
   // between lnode and rnode
   const bool is_boundary = (lnode->node_type == Node::HIS_NODE ||
                             segmenter_->IsBoundary(*lnode, *rnode, false));
diff --git converter/nbest_generator.h converter/nbest_generator.h
index 1eedd3006..958c892f8 100644
--- converter/nbest_generator.h
+++ converter/nbest_generator.h
@@ -57,7 +57,7 @@ class NBestGenerator {
     //   Candidate edge:      |  candidate  |
     //   Nodes:        |Node A|Node B|Node C|Node D|
 
-    // For normal converison.
+    // For normal conversion.
     //  Candidate boundary is strictly same as inner boundary.
     // A-B: Should be the boundary
     // B-C: Should not be the boundary
@@ -79,7 +79,7 @@ class NBestGenerator {
     ONLY_EDGE,
   };
 
-  // Try to enumurate N-best results between begin_node and end_node.
+  // Try to enumerate N-best results between begin_node and end_node.
   NBestGenerator(
       const dictionary::SuppressionDictionary *suppression_dictionary,
       const Segmenter *segmenter, const Connector *connector,
diff --git converter/pos_id_printer_test.cc converter/pos_id_printer_test.cc
index 0d099d6e9..be8a2437f 100644
--- converter/pos_id_printer_test.cc
+++ converter/pos_id_printer_test.cc
@@ -34,9 +34,9 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/mozctest.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
diff --git converter/quality_regression_main.cc converter/quality_regression_main.cc
index 94b6aa905..0b7cea0b4 100644
--- converter/quality_regression_main.cc
+++ converter/quality_regression_main.cc
@@ -32,14 +32,14 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/util.h"
 #include "converter/quality_regression_util.h"
 #include "engine/engine_factory.h"
 #include "engine/engine_interface.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, test_file, "", "regression test file");
+ABSL_FLAG(std::string, test_file, "", "regression test file");
 
 using mozc::EngineFactory;
 using mozc::EngineInterface;
@@ -52,7 +52,7 @@ int main(int argc, char **argv) {
   QualityRegressionUtil util(engine->GetConverter());
 
   std::vector<QualityRegressionUtil::TestItem> items;
-  QualityRegressionUtil::ParseFile(mozc::GetFlag(FLAGS_test_file), &items);
+  QualityRegressionUtil::ParseFile(absl::GetFlag(FLAGS_test_file), &items);
 
   for (size_t i = 0; i < items.size(); ++i) {
     std::string actual_value;
diff --git converter/segmenter.cc converter/segmenter.cc
index 9d31f8fce..362461e1d 100644
--- converter/segmenter.cc
+++ converter/segmenter.cc
@@ -91,7 +91,7 @@ bool Segmenter::IsBoundary(const Node &lnode, const Node &rnode,
   // This hack is for handling ambiguous bunsetsu segmentation.
   // e.g. "かみ|にかく" => "紙|に書く" or "紙二角".
   // If we segment "に書く" into two segments, "二角" is never be shown.
-  // There exits some implicit assumpution that user expects that his/her input
+  // There exits some implicit assumpution that user expects that their input
   // becomes one bunsetu. So, it would be better to keep "二角" even after "紙".
   if (lnode.attributes & Node::STARTS_WITH_PARTICLE) {
     return false;
diff --git data/images/mac/BUILD data/images/mac/BUILD
index bd6eb9bcc..9fc04923a 100644
--- data/images/mac/BUILD
+++ data/images/mac/BUILD
@@ -30,5 +30,11 @@
 
 exports_files([
     "candidate_window_logo.tiff",
+    "direct.tiff",
+    "full_ascii.tiff",
+    "full_katakana.tiff",
+    "half_ascii.tiff",
+    "half_katakana.tiff",
+    "hiragana.tiff",
     "product_icon.icns",
 ])
diff --git data/installer/BUILD data/installer/BUILD
index dcd9e0736..78dc3c546 100644
--- data/installer/BUILD
+++ data/installer/BUILD
@@ -28,7 +28,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-exports_files(glob(["*"]))
+exports_files(["credits_en.html"])
 
 genrule(
     name = "android_asset_licenses",
diff --git data/installer/credits_en.html data/installer/credits_en.html
index df694e8ad..ab1796683 100644
--- data/installer/credits_en.html
+++ data/installer/credits_en.html
@@ -47,7 +47,7 @@
   white-space:pre-wrap;
 }
 .licence h3 {
-  margin-top:0px;
+  margin-top:0;
 }
 </style>
 </head>
diff --git data/test/calculator/gen_test.py data/test/calculator/gen_test.py
index 98f99d84b..fa11d6118 100644
--- data/test/calculator/gen_test.py
+++ data/test/calculator/gen_test.py
@@ -47,7 +47,7 @@
 # values of ans are really correct, the script itself does "test-for-test"
 # using python's eval() function. Namely, after building an expression tree,
 # we generate a python expression corresponding to the tree and compare its
-# value with that of the the direct evaluation. This test runs automatically
+# value with that of the direct evaluation. This test runs automatically
 # inside the script, but you can also write it to a file by specifying
 # --py_output option. Furthermore, passing --cc_output options enables you to
 # generate C++ code, respectively, that warns about expressions if results in
@@ -287,7 +287,7 @@ def eval(self):
 
   def build_test_expr(self):
     # If the child expression is one of the following, then we can omit
-    # parentheses becase of precedence.
+    # parentheses because of precedence.
     if (isinstance(self._expr, Number) or
         isinstance(self._expr, UnaryExpr) or
         isinstance(self._expr, Group)):
diff --git data/version/mozc_version_template.bzl data/version/mozc_version_template.bzl
index b60a9ccbb..4c848ce8f 100644
--- data/version/mozc_version_template.bzl
+++ data/version/mozc_version_template.bzl
@@ -33,7 +33,7 @@ MAJOR = 2
 MINOR = 26
 
 # Number to be increased. This value may be replaced by other tools.
-BUILD = 4276
+BUILD = 4282
 
 # Represent the platform and release channel.
 REVISION = 100
diff --git data_manager/BUILD data_manager/BUILD
index 98732e8ff..951241038 100644
--- data_manager/BUILD
+++ data_manager/BUILD
@@ -172,11 +172,11 @@ cc_test_mozc(
         ":dataset_writer",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:obfuscator_support",
         "//base:util",
         "//testing:gunit_main",
         "//testing:mozctest",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -189,11 +189,11 @@ cc_binary_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:number_util",
         "//base:util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git data_manager/dataset_writer_main.cc data_manager/dataset_writer_main.cc
index dc279bdda..2ada473b1 100644
--- data_manager/dataset_writer_main.cc
+++ data_manager/dataset_writer_main.cc
@@ -47,23 +47,23 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/number_util.h"
 #include "base/util.h"
 #include "data_manager/dataset_writer.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, magic, "", "Hex-encoded magic number to be embedded");
-MOZC_FLAG(string, output, "", "Output file");
+ABSL_FLAG(std::string, magic, "", "Hex-encoded magic number to be embedded");
+ABSL_FLAG(std::string, output, "", "Output file");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   std::string magic;
-  CHECK(mozc::Util::Unescape(mozc::GetFlag(FLAGS_magic), &magic))
+  CHECK(mozc::Util::Unescape(absl::GetFlag(FLAGS_magic), &magic))
       << "magic number is not a proper hex-escaped string: "
-      << mozc::GetFlag(FLAGS_magic);
+      << absl::GetFlag(FLAGS_magic);
 
   struct Input {
     Input(const std::string &n, int a, const std::string &f)
@@ -87,12 +87,12 @@ int main(int argc, char **argv) {
                         params[2]);
   }
 
-  CHECK(!mozc::GetFlag(FLAGS_output).empty()) << "--output is required";
+  CHECK(!absl::GetFlag(FLAGS_output).empty()) << "--output is required";
 
   // DataSetWriter directly writes to the specified stream, so if it fails for
   // an input, the output contains a partial result.  To avoid such partial file
   // creation, write to a temporary file then rename it.
-  const std::string tmpfile = mozc::GetFlag(FLAGS_output) + ".tmp";
+  const std::string tmpfile = absl::GetFlag(FLAGS_output) + ".tmp";
   {
     mozc::DataSetWriter writer(magic);
     for (const auto &input : inputs) {
@@ -105,9 +105,9 @@ int main(int argc, char **argv) {
     writer.Finish(&output);
     output.close();
   }
-  CHECK(mozc::FileUtil::AtomicRename(tmpfile, mozc::GetFlag(FLAGS_output)))
+  CHECK(mozc::FileUtil::AtomicRename(tmpfile, absl::GetFlag(FLAGS_output)))
       << "Failed to rename " << tmpfile << " to "
-      << mozc::GetFlag(FLAGS_output);
+      << absl::GetFlag(FLAGS_output);
 
   return 0;
 }
diff --git data_manager/dataset_writer_test.cc data_manager/dataset_writer_test.cc
index 14a5664ed..c76b537c3 100644
--- data_manager/dataset_writer_test.cc
+++ data_manager/dataset_writer_test.cc
@@ -34,12 +34,12 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/unverified_sha1.h"
 #include "base/util.h"
 #include "data_manager/dataset.pb.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -54,7 +54,7 @@ void SetEntry(const string &name, uint64 offset, uint64 size,
 TEST(DatasetWriterTest, Write) {
   // Create a dummy file to be packed.
   const string &in =
-      FileUtil::JoinPath({mozc::GetFlag(FLAGS_test_tmpdir), "in"});
+      FileUtil::JoinPath({absl::GetFlag(FLAGS_test_tmpdir), "in"});
   {
     OutputFileStream f(in.c_str(), std::ios_base::out | std::ios_base::binary);
     f.write("m\0zc\xEF", 5);
diff --git data_manager/mozc_data.bzl data_manager/mozc_data.bzl
index 276158a66..3bd943718 100644
--- data_manager/mozc_data.bzl
+++ data_manager/mozc_data.bzl
@@ -404,10 +404,10 @@ def mozc_dataset(
         copts = ["-Wno-parentheses"],
         deps = [
             "//base",
-            "//base:flags",
             "//base:init_mozc_buildtool",
             "//converter:gen_segmenter_bitarray",
             "//:macro",
+            "@com_google_absl//absl/flags:flag",
         ],
     )
 
diff --git data_manager/oss/gen_oss_segmenter_bitarray_main.cc data_manager/oss/gen_oss_segmenter_bitarray_main.cc
index 6d5675933..7eb971b65 100644
--- data_manager/oss/gen_oss_segmenter_bitarray_main.cc
+++ data_manager/oss/gen_oss_segmenter_bitarray_main.cc
@@ -27,24 +27,25 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "converter/gen_segmenter_bitarray.h"
+#include "absl/flags/flag.h"
 
 namespace {
 #include "data_manager/oss/segmenter_inl.inc"
 }
 
-MOZC_FLAG(string, output_size_info, "", "Serialized SegmenterDataSizeInfo");
-MOZC_FLAG(string, output_ltable, "", "LTable array");
-MOZC_FLAG(string, output_rtable, "", "RTable array");
-MOZC_FLAG(string, output_bitarray, "", "Segmenter bitarray");
+ABSL_FLAG(std::string, output_size_info, "",
+          "Serialized SegmenterDataSizeInfo");
+ABSL_FLAG(std::string, output_ltable, "", "LTable array");
+ABSL_FLAG(std::string, output_rtable, "", "RTable array");
+ABSL_FLAG(std::string, output_bitarray, "", "Segmenter bitarray");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
   mozc::SegmenterBitarrayGenerator::GenerateBitarray(
       kLSize, kRSize, &IsBoundaryInternal,
-      mozc::GetFlag(FLAGS_output_size_info), mozc::GetFlag(FLAGS_output_ltable),
-      mozc::GetFlag(FLAGS_output_rtable), mozc::GetFlag(FLAGS_output_bitarray));
+      absl::GetFlag(FLAGS_output_size_info), absl::GetFlag(FLAGS_output_ltable),
+      absl::GetFlag(FLAGS_output_rtable), absl::GetFlag(FLAGS_output_bitarray));
   return 0;
 }
diff --git data_manager/testing/gen_mock_segmenter_bitarray_main.cc data_manager/testing/gen_mock_segmenter_bitarray_main.cc
index 4b4739a2f..15a692a88 100644
--- data_manager/testing/gen_mock_segmenter_bitarray_main.cc
+++ data_manager/testing/gen_mock_segmenter_bitarray_main.cc
@@ -27,24 +27,25 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "converter/gen_segmenter_bitarray.h"
+#include "absl/flags/flag.h"
 
 namespace {
 #include "data_manager/testing/segmenter_inl.inc"
 }
 
-MOZC_FLAG(string, output_size_info, "", "Serialized SegmenterDataSizeInfo");
-MOZC_FLAG(string, output_ltable, "", "LTable array");
-MOZC_FLAG(string, output_rtable, "", "RTable array");
-MOZC_FLAG(string, output_bitarray, "", "Segmenter bitarray");
+ABSL_FLAG(std::string, output_size_info, "",
+          "Serialized SegmenterDataSizeInfo");
+ABSL_FLAG(std::string, output_ltable, "", "LTable array");
+ABSL_FLAG(std::string, output_rtable, "", "RTable array");
+ABSL_FLAG(std::string, output_bitarray, "", "Segmenter bitarray");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
   mozc::SegmenterBitarrayGenerator::GenerateBitarray(
       kLSize, kRSize, &IsBoundaryInternal,
-      mozc::GetFlag(FLAGS_output_size_info), mozc::GetFlag(FLAGS_output_ltable),
-      mozc::GetFlag(FLAGS_output_rtable), mozc::GetFlag(FLAGS_output_bitarray));
+      absl::GetFlag(FLAGS_output_size_info), absl::GetFlag(FLAGS_output_ltable),
+      absl::GetFlag(FLAGS_output_rtable), absl::GetFlag(FLAGS_output_bitarray));
   return 0;
 }
diff --git dictionary/BUILD dictionary/BUILD
index 18655cb58..d14deb922 100644
--- dictionary/BUILD
+++ dictionary/BUILD
@@ -188,7 +188,6 @@ cc_test_mozc(
         ":user_pos",
         ":user_pos_interface",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:singleton",
@@ -201,6 +200,7 @@ cc_test_mozc(
         "//testing:mozctest",
         "//usage_stats",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -299,11 +299,11 @@ cc_test_mozc(
         ":user_dictionary_storage",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:system_util",
         "//protocol:user_dictionary_storage_proto",
         "//testing:gunit_main",
         "//testing:testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -337,13 +337,13 @@ cc_test_mozc(
         ":user_dictionary_session_handler",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:system_util",
         "//base/protobuf",
         "//base/protobuf:repeated_field",
         "//protocol:user_dictionary_storage_proto",
         "//testing:gunit_main",
         "//testing:testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -380,12 +380,12 @@ cc_test_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:mmap",
         "//base:system_util",
         "//base:util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -481,7 +481,6 @@ cc_library_mozc(
         ":pos_matcher_lib",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:iterator_adapter",
         "//base:logging",
         "//base:multifile",
@@ -490,6 +489,7 @@ cc_library_mozc(
         "//base:stl_util",
         "//base:util",
         "//testing:gunit_prod",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -507,10 +507,10 @@ cc_test_mozc(
         ":text_dictionary_loader",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:util",
         "//data_manager/testing:mock_data_manager",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -646,12 +646,12 @@ cc_binary_mozc(
         ":text_dictionary_loader",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:util",
         "//data_manager",
         "//dictionary/system:system_dictionary_builder",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git dictionary/file/BUILD dictionary/file/BUILD
index 408609501..69b8cdc9f 100644
--- dictionary/file/BUILD
+++ dictionary/file/BUILD
@@ -84,9 +84,9 @@ cc_test_mozc(
         ":dictionary_file_builder",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -166,10 +166,10 @@ cc_test_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
diff --git dictionary/file/codec_test.cc dictionary/file/codec_test.cc
index 44c1721d5..258d816f9 100644
--- dictionary/file/codec_test.cc
+++ dictionary/file/codec_test.cc
@@ -33,7 +33,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "dictionary/file/codec_factory.h"
@@ -41,6 +40,7 @@
 #include "dictionary/file/section.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -49,7 +49,7 @@ namespace {
 
 class CodecTest : public ::testing::Test {
  public:
-  CodecTest() : test_file_(mozc::GetFlag(FLAGS_test_tmpdir) + "testfile.txt") {}
+  CodecTest() : test_file_(absl::GetFlag(FLAGS_test_tmpdir) + "testfile.txt") {}
 
  protected:
   void SetUp() override {
diff --git dictionary/file/dictionary_file_test.cc dictionary/file/dictionary_file_test.cc
index 2ad145f51..4e8e76621 100644
--- dictionary/file/dictionary_file_test.cc
+++ dictionary/file/dictionary_file_test.cc
@@ -33,21 +33,21 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "dictionary/file/codec_factory.h"
 #include "dictionary/file/dictionary_file_builder.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace dictionary {
 namespace {
 
 TEST(DictionaryFileTest, Basic) {
-  const std::string dfn = mozc::GetFlag(FLAGS_test_tmpdir) + "/test-dictionary";
-  const std::string fn1 = mozc::GetFlag(FLAGS_test_tmpdir) + "/sec1";
-  const std::string fn2 = mozc::GetFlag(FLAGS_test_tmpdir) + "/sec2";
+  const std::string dfn = absl::GetFlag(FLAGS_test_tmpdir) + "/test-dictionary";
+  const std::string fn1 = absl::GetFlag(FLAGS_test_tmpdir) + "/sec1";
+  const std::string fn2 = absl::GetFlag(FLAGS_test_tmpdir) + "/sec2";
 
   FILE *fp1 = fopen(fn1.c_str(), "w");
   CHECK(fp1) << "failed to open temporary file";
diff --git dictionary/gen_system_dictionary_data_main.cc dictionary/gen_system_dictionary_data_main.cc
index 81400bf04..e10fc8e28 100644
--- dictionary/gen_system_dictionary_data_main.cc
+++ dictionary/gen_system_dictionary_data_main.cc
@@ -39,7 +39,6 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
@@ -48,11 +47,12 @@
 #include "dictionary/pos_matcher.h"
 #include "dictionary/system/system_dictionary_builder.h"
 #include "dictionary/text_dictionary_loader.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(string, input, "", "space separated input text files");
-MOZC_FLAG(string, user_pos_manager_data, "", "user pos manager data");
-MOZC_FLAG(string, output, "", "output binary file");
+ABSL_FLAG(std::string, input, "", "space separated input text files");
+ABSL_FLAG(std::string, user_pos_manager_data, "", "user pos manager data");
+ABSL_FLAG(std::string, output, "", "output binary file");
 
 namespace mozc {
 namespace {
@@ -95,7 +95,7 @@ int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   std::string system_dictionary_input, reading_correction_input;
-  mozc::GetInputFileName(mozc::GetFlag(FLAGS_input), &system_dictionary_input,
+  mozc::GetInputFileName(absl::GetFlag(FLAGS_input), &system_dictionary_input,
                          &reading_correction_input);
 
   // User POS manager data for build tools has no magic number.
@@ -103,10 +103,10 @@ int main(int argc, char **argv) {
   mozc::DataManager data_manager;
   const mozc::DataManager::Status status =
       data_manager.InitUserPosManagerDataFromFile(
-          mozc::GetFlag(FLAGS_user_pos_manager_data), kMagicNumber);
+          absl::GetFlag(FLAGS_user_pos_manager_data), kMagicNumber);
   CHECK_EQ(status, mozc::DataManager::Status::OK)
       << "Failed to initialize data manager from "
-      << mozc::GetFlag(FLAGS_user_pos_manager_data);
+      << absl::GetFlag(FLAGS_user_pos_manager_data);
 
   const mozc::dictionary::POSMatcher pos_matcher(
       data_manager.GetPOSMatcherData());
@@ -118,8 +118,8 @@ int main(int argc, char **argv) {
   builder.BuildFromTokens(loader.tokens());
 
   std::unique_ptr<std::ostream> output_stream(new mozc::OutputFileStream(
-      mozc::GetFlag(FLAGS_output).c_str(), std::ios::out | std::ios::binary));
-  builder.WriteToStream(mozc::GetFlag(FLAGS_output), output_stream.get());
+      absl::GetFlag(FLAGS_output).c_str(), std::ios::out | std::ios::binary));
+  builder.WriteToStream(absl::GetFlag(FLAGS_output), output_stream.get());
 
   return 0;
 }
diff --git dictionary/suppression_dictionary.cc dictionary/suppression_dictionary.cc
index ed5e6219e..9720aaa03 100644
--- dictionary/suppression_dictionary.cc
+++ dictionary/suppression_dictionary.cc
@@ -98,7 +98,7 @@ bool SuppressionDictionary::IsEmpty() const {
 bool SuppressionDictionary::SuppressEntry(const std::string &key,
                                           const std::string &value) const {
   if (dic_.empty()) {
-    // Almost all users don't use word supresssion function.
+    // Almost all users don't use word suppression function.
     // We can return false as early as possible
     return false;
   }
diff --git dictionary/suppression_dictionary.h dictionary/suppression_dictionary.h
index 80669eeb6..dd71fa626 100644
--- dictionary/suppression_dictionary.h
+++ dictionary/suppression_dictionary.h
@@ -46,10 +46,10 @@ class SuppressionDictionary {
 
   // Locks dictionary.
   // Need to lock before calling AddEntry() or Clear().
-  // When the dictionary is locked, Supress() return false.
+  // When the dictionary is locked, Suppress() return false.
   //
   // NOTE:
-  // Lock() and SupressWord() must be called synchronously.
+  // Lock() and SuppressWord() must be called synchronously.
   void Lock();
 
   // Unlocks dictionary.
@@ -67,7 +67,7 @@ class SuppressionDictionary {
   // Returns true if SuppressionDictionary doesn't have any entries.
   bool IsEmpty() const;
 
-  // Returns true if |word| should be suppressed.  If the current dictionay is
+  // Returns true if |word| should be suppressed.  If the current dictionary is
   // "locked" via Lock() method, this function always return false.  Lock() and
   // SuppressWord() must be called synchronously.
   bool SuppressEntry(const std::string &key, const std::string &value) const;
diff --git dictionary/suppression_dictionary_test.cc dictionary/suppression_dictionary_test.cc
index 086d3924a..5e275af51 100644
--- dictionary/suppression_dictionary_test.cc
+++ dictionary/suppression_dictionary_test.cc
@@ -42,7 +42,7 @@ namespace mozc {
 namespace dictionary {
 namespace {
 
-TEST(SupressionDictionary, BasicTest) {
+TEST(SuppressionDictionary, BasicTest) {
   SuppressionDictionary *dic = Singleton<SuppressionDictionary>::get();
   CHECK(dic);
 
@@ -126,7 +126,7 @@ class DictionaryLoaderThread : public Thread {
   }
 };
 
-TEST(SupressionDictionary, ThreadTest) {
+TEST(SuppressionDictionary, ThreadTest) {
   SuppressionDictionary *dic = Singleton<SuppressionDictionary>::get();
   CHECK(dic);
 
diff --git dictionary/system/BUILD dictionary/system/BUILD
index abe03f02e..e7e52dc34 100644
--- dictionary/system/BUILD
+++ dictionary/system/BUILD
@@ -164,7 +164,6 @@ cc_library_mozc(
         ":codec",
         ":words_info",
         "//base:file_stream",
-        "//base:flags",
         "//base:logging",
         "//base:mozc_hash_set",
         "//base:port",
@@ -200,7 +199,6 @@ cc_test_mozc(
         ":system_dictionary",
         ":system_dictionary_builder",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:stl_util",
@@ -253,13 +251,13 @@ cc_test_mozc(
         ":system_dictionary",
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:logging",
         "//base:util",
         "//dictionary:dictionary_test_util",
         "//request:conversion_request",
         "//testing:gunit_main",
         "//testing/base/public:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git dictionary/system/system_dictionary.cc dictionary/system/system_dictionary.cc
index 2cffb3ab1..d0d19a0bd 100644
--- dictionary/system/system_dictionary.cc
+++ dictionary/system/system_dictionary.cc
@@ -862,7 +862,7 @@ class ReverseLookupCallbackWrapper : public DictionaryInterface::Callback {
 
 }  // namespace
 
-// Recursive implemention of depth-first prefix search with key expansion.
+// Recursive implementation of depth-first prefix search with key expansion.
 // Input parameters:
 //   key:
 //     The head address of the original key before applying codec.
diff --git dictionary/system/system_dictionary_builder.cc dictionary/system/system_dictionary_builder.cc
index f4645851e..6ddc84082 100644
--- dictionary/system/system_dictionary_builder.cc
+++ dictionary/system/system_dictionary_builder.cc
@@ -35,7 +35,6 @@
 #include <sstream>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/mozc_hash_set.h"
 #include "base/util.h"
@@ -51,9 +50,9 @@
 #include "storage/louds/louds_trie_builder.h"
 #include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, preserve_intermediate_dictionary, false,
+ABSL_FLAG(bool, preserve_intermediate_dictionary, false,
           "preserve inetemediate dictionary file.");
-MOZC_FLAG(int32, min_key_length_to_use_small_cost_encoding, 6,
+ABSL_FLAG(int32, min_key_length_to_use_small_cost_encoding, 6,
           "minimum key length to use 1 byte cost encoding.");
 
 namespace mozc {
@@ -163,7 +162,7 @@ void SystemDictionaryBuilder::WriteToStream(
       file_codec_->GetSectionName(codec_->GetSectionNameForPos()));
   sections.push_back(frequent_pos_section);
 
-  if (mozc::GetFlag(FLAGS_preserve_intermediate_dictionary) &&
+  if (absl::GetFlag(FLAGS_preserve_intermediate_dictionary) &&
       !intermediate_output_file_base_path.empty()) {
     // Write out intermediate results to files.
     const std::string &basepath = intermediate_output_file_base_path;
@@ -366,7 +365,7 @@ void SystemDictionaryBuilder::SetCostType(KeyInfoList *key_info_list) const {
       TokenInfo *token_info = &key_info->tokens[i];
       const int key_len = Util::CharsLen(token_info->token->key);
       if (key_len >=
-          mozc::GetFlag(FLAGS_min_key_length_to_use_small_cost_encoding)) {
+          absl::GetFlag(FLAGS_min_key_length_to_use_small_cost_encoding)) {
         token_info->cost_type = TokenInfo::CAN_USE_SMALL_ENCODING;
       }
     }
diff --git dictionary/system/system_dictionary_test.cc dictionary/system/system_dictionary_test.cc
index c0ceee35f..9409fc597 100644
--- dictionary/system/system_dictionary_test.cc
+++ dictionary/system/system_dictionary_test.cc
@@ -38,7 +38,6 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/stl_util.h"
@@ -58,13 +57,15 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/mozctest.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(int32, dictionary_test_size, 100000,
+ABSL_FLAG(int32, dictionary_test_size, 100000,
           "Dictionary size for this test.");
-MOZC_FLAG(int32, dictionary_reverse_lookup_test_size, 1000,
+ABSL_FLAG(int32, dictionary_reverse_lookup_test_size, 1000,
           "Number of tokens to run reverse lookup test.");
-MOZC_DECLARE_FLAG(int32, min_key_length_to_use_small_cost_encoding);
+ABSL_DECLARE_FLAG(int32, min_key_length_to_use_small_cost_encoding);
 
 namespace mozc {
 namespace dictionary {
@@ -75,11 +76,11 @@ class SystemDictionaryTest : public ::testing::Test {
       : pos_matcher_(mock_data_manager_.GetPOSMatcherData()),
         text_dict_(new TextDictionaryLoader(pos_matcher_)),
         dic_fn_(
-            FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "mozc.dic")) {
+            FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "mozc.dic")) {
     const std::string dic_path = mozc::testing::GetSourceFileOrDie(
         {"data", "dictionary_oss", "dictionary00.txt"});
     text_dict_->LoadWithLineLimit(dic_path, "",
-                                  mozc::GetFlag(FLAGS_dictionary_test_size));
+                                  absl::GetFlag(FLAGS_dictionary_test_size));
 
     convreq_.set_request(&request_);
     convreq_.set_config(&config_);
@@ -88,8 +89,8 @@ class SystemDictionaryTest : public ::testing::Test {
   void SetUp() override {
     // Don't use small cost encoding by default.
     original_flags_min_key_length_to_use_small_cost_encoding_ =
-        mozc::GetFlag(FLAGS_min_key_length_to_use_small_cost_encoding);
-    mozc::SetFlag(&FLAGS_min_key_length_to_use_small_cost_encoding,
+        absl::GetFlag(FLAGS_min_key_length_to_use_small_cost_encoding);
+    absl::SetFlag(&FLAGS_min_key_length_to_use_small_cost_encoding,
                   std::numeric_limits<int32>::max());
 
     request_.Clear();
@@ -97,7 +98,7 @@ class SystemDictionaryTest : public ::testing::Test {
   }
 
   void TearDown() override {
-    mozc::SetFlag(&FLAGS_min_key_length_to_use_small_cost_encoding,
+    absl::SetFlag(&FLAGS_min_key_length_to_use_small_cost_encoding,
                   original_flags_min_key_length_to_use_small_cost_encoding_);
 
     // This config initialization will be removed once ConversionRequest can
@@ -265,7 +266,7 @@ TEST_F(SystemDictionaryTest, NormalWord) {
   t0->rid = 70;
   source_tokens.push_back(t0.get());
   BuildSystemDictionary(source_tokens,
-                        mozc::GetFlag(FLAGS_dictionary_test_size));
+                        absl::GetFlag(FLAGS_dictionary_test_size));
 
   std::unique_ptr<SystemDictionary> system_dic =
       SystemDictionary::Builder(dic_fn_).Build().value();
@@ -322,7 +323,7 @@ TEST_F(SystemDictionaryTest, SameWord) {
     source_tokens.push_back(&tokens[i]);
   }
   BuildSystemDictionary(source_tokens,
-                        mozc::GetFlag(FLAGS_dictionary_test_size));
+                        absl::GetFlag(FLAGS_dictionary_test_size));
 
   std::unique_ptr<SystemDictionary> system_dic =
       SystemDictionary::Builder(dic_fn_).Build().value();
@@ -337,7 +338,7 @@ TEST_F(SystemDictionaryTest, SameWord) {
 TEST_F(SystemDictionaryTest, LookupAllWords) {
   const std::vector<Token *> &source_tokens = text_dict_->tokens();
   BuildSystemDictionary(source_tokens,
-                        mozc::GetFlag(FLAGS_dictionary_test_size));
+                        absl::GetFlag(FLAGS_dictionary_test_size));
 
   std::unique_ptr<SystemDictionary> system_dic =
       SystemDictionary::Builder(dic_fn_).Build().value();
@@ -708,7 +709,7 @@ TEST_F(SystemDictionaryTest, LookupReverse) {
   ASSERT_TRUE(system_dic) << "Failed to open dictionary source:" << dic_fn_;
   const size_t test_size =
       std::min(static_cast<size_t>(
-                   mozc::GetFlag(FLAGS_dictionary_reverse_lookup_test_size)),
+                   absl::GetFlag(FLAGS_dictionary_reverse_lookup_test_size)),
                source_tokens.size());
   for (size_t source_index = 0; source_index < test_size; ++source_index) {
     const Token &source_token = *source_tokens[source_index];
@@ -767,7 +768,7 @@ TEST_F(SystemDictionaryTest, LookupReverse) {
 TEST_F(SystemDictionaryTest, LookupReverseIndex) {
   const std::vector<Token *> &source_tokens = text_dict_->tokens();
   BuildSystemDictionary(source_tokens,
-                        mozc::GetFlag(FLAGS_dictionary_test_size));
+                        absl::GetFlag(FLAGS_dictionary_test_size));
 
   std::unique_ptr<SystemDictionary> system_dic_without_index =
       SystemDictionary::Builder(dic_fn_)
@@ -785,7 +786,7 @@ TEST_F(SystemDictionaryTest, LookupReverseIndex) {
       << "Failed to open dictionary source:" << dic_fn_;
 
   std::vector<Token *>::const_iterator it;
-  int size = mozc::GetFlag(FLAGS_dictionary_reverse_lookup_test_size);
+  int size = absl::GetFlag(FLAGS_dictionary_reverse_lookup_test_size);
   for (it = source_tokens.begin(); size > 0 && it != source_tokens.end();
        ++it, --size) {
     const Token &t = **it;
diff --git dictionary/text_dictionary_loader.cc dictionary/text_dictionary_loader.cc
index 5aea84a6a..d2b3618ab 100644
--- dictionary/text_dictionary_loader.cc
+++ dictionary/text_dictionary_loader.cc
@@ -40,7 +40,6 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/iterator_adapter.h"
 #include "base/logging.h"
 #include "base/multifile.h"
@@ -49,9 +48,10 @@
 #include "base/util.h"
 #include "dictionary/dictionary_token.h"
 #include "dictionary/pos_matcher.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(int32, tokens_reserve_size, 1400000,
+ABSL_FLAG(int32, tokens_reserve_size, 1400000,
           "Reserve the specified size of token buffer in advance.");
 
 namespace mozc {
@@ -168,7 +168,7 @@ void TextDictionaryLoader::LoadWithLineLimit(
 
   // Roughly allocate buffers for Token pointers.
   if (limit < 0) {
-    tokens_.reserve(mozc::GetFlag(FLAGS_tokens_reserve_size));
+    tokens_.reserve(absl::GetFlag(FLAGS_tokens_reserve_size));
     limit = std::numeric_limits<int>::max();
   } else {
     tokens_.reserve(limit);
diff --git dictionary/text_dictionary_loader_test.cc dictionary/text_dictionary_loader_test.cc
index 7bf174c6c..2f061f8db 100644
--- dictionary/text_dictionary_loader_test.cc
+++ dictionary/text_dictionary_loader_test.cc
@@ -35,13 +35,13 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/util.h"
 #include "data_manager/testing/mock_data_manager.h"
 #include "dictionary/dictionary_token.h"
 #include "dictionary/pos_matcher.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 using std::unique_ptr;
 
@@ -89,7 +89,7 @@ TEST_F(TextDictionaryLoaderTest, BasicTest) {
   }
 
   const std::string filename =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.tsv");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.tsv");
   {
     OutputFileStream ofs(filename.c_str());
     ofs << kTextLines;
@@ -214,9 +214,9 @@ TEST_F(TextDictionaryLoaderTest, RewriteSpecialTokenTest) {
 
 TEST_F(TextDictionaryLoaderTest, LoadMultipleFilesTest) {
   const std::string filename1 =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test1.tsv");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test1.tsv");
   const std::string filename2 =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test2.tsv");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test2.tsv");
   const std::string filename = filename1 + "," + filename2;
 
   {
@@ -242,9 +242,9 @@ TEST_F(TextDictionaryLoaderTest, ReadingCorrectionTest) {
   unique_ptr<TextDictionaryLoader> loader(CreateTextDictionaryLoader());
 
   const std::string dic_filename =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.tsv");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.tsv");
   const std::string reading_correction_filename = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "reading_correction.tsv");
+      absl::GetFlag(FLAGS_test_tmpdir), "reading_correction.tsv");
 
   {
     OutputFileStream ofs(dic_filename.c_str());
diff --git dictionary/user_dictionary_session.h dictionary/user_dictionary_session.h
index 82d3a251a..2137cdd80 100644
--- dictionary/user_dictionary_session.h
+++ dictionary/user_dictionary_session.h
@@ -71,7 +71,7 @@ class UserDictionarySession {
   // or not), creates an empty dictionary in the storage with the default name.
   UserDictionaryCommandStatus::Status LoadWithEnsuringNonEmptyStorage();
 
-  // Saves the data to local stroage.
+  // Saves the data to local storage.
   UserDictionaryCommandStatus::Status Save();
 
   // Undoes the last operation.
diff --git dictionary/user_dictionary_session_handler_test.cc dictionary/user_dictionary_session_handler_test.cc
index b45638cc5..c2208ec13 100644
--- dictionary/user_dictionary_session_handler_test.cc
+++ dictionary/user_dictionary_session_handler_test.cc
@@ -35,7 +35,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/protobuf/protobuf.h"
 #include "base/protobuf/repeated_field.h"
 #include "base/system_util.h"
@@ -43,6 +42,7 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -68,7 +68,7 @@ class UserDictionarySessionHandlerTest : public ::testing::Test {
  protected:
   void SetUp() override {
     original_user_profile_directory_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     FileUtil::Unlink(GetUserDictionaryFile());
 
     handler_ = absl::make_unique<UserDictionarySessionHandler>();
@@ -89,7 +89,7 @@ class UserDictionarySessionHandlerTest : public ::testing::Test {
   }
 
   static std::string GetUserDictionaryFile() {
-    return FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.db");
+    return FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.db");
   }
 
   uint64 CreateSession() {
diff --git dictionary/user_dictionary_session_test.cc dictionary/user_dictionary_session_test.cc
index 229117cfc..3b9729aa4 100644
--- dictionary/user_dictionary_session_test.cc
+++ dictionary/user_dictionary_session_test.cc
@@ -34,13 +34,13 @@
 #endif  // OS_WIN
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "dictionary/user_dictionary_storage.h"
 #include "protocol/user_dictionary_storage.pb.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/testing_util.h"
+#include "absl/flags/flag.h"
 
 namespace {
 
@@ -61,7 +61,7 @@ class UserDictionarySessionTest : public ::testing::Test {
  protected:
   void SetUp() override {
     original_user_profile_directory_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     FileUtil::Unlink(GetUserDictionaryFile());
   }
 
@@ -72,9 +72,9 @@ class UserDictionarySessionTest : public ::testing::Test {
 
   static std::string GetUserDictionaryFile() {
 #ifndef OS_WIN
-    chmod(mozc::GetFlag(FLAGS_test_tmpdir).c_str(), 0777);
+    chmod(absl::GetFlag(FLAGS_test_tmpdir).c_str(), 0777);
 #endif  // OS_WIN
-    return FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.db");
+    return FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.db");
   }
 
   void ResetEntry(const std::string &key, const std::string &value,
@@ -217,7 +217,7 @@ TEST_F(UserDictionarySessionTest, DeleteDictionary) {
   EXPECT_EQ(kDummyId, session.storage().dictionaries(0).id());
 }
 
-TEST_F(UserDictionarySessionTest, DeleteDictionaryWithEnsuringNonEmptyStroage) {
+TEST_F(UserDictionarySessionTest, DeleteDictionaryWithEnsuringNonEmptyStorage) {
   UserDictionarySession session(GetUserDictionaryFile());
   session.SetDefaultDictionaryName("abcde");
 
diff --git dictionary/user_dictionary_storage.h dictionary/user_dictionary_storage.h
index 6d9e7ebb2..dd5b0cd43 100644
--- dictionary/user_dictionary_storage.h
+++ dictionary/user_dictionary_storage.h
@@ -113,7 +113,7 @@ class UserDictionaryStorage {
   //       is kept as is.
   bool Load();
 
-  // Serialzie user dictionary to local file.
+  // Serialize user dictionary to local file.
   // Need to call Lock() the dictionary before calling Save().
   bool Save();
 
@@ -166,7 +166,7 @@ class UserDictionaryStorage {
   static int CountSyncableDictionaries(
       const user_dictionary::UserDictionaryStorage &storage);
 
-  // maxium number of dictionaries this storage can hold
+  // maximum number of dictionaries this storage can hold
   static size_t max_dictionary_size();
 
   // maximum number of entries one dictionary can hold
diff --git dictionary/user_dictionary_storage_test.cc dictionary/user_dictionary_storage_test.cc
index 8af3b888c..d153f0fac 100644
--- dictionary/user_dictionary_storage_test.cc
+++ dictionary/user_dictionary_storage_test.cc
@@ -34,7 +34,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/mmap.h"
 #include "base/system_util.h"
@@ -43,6 +42,7 @@
 #include "dictionary/user_dictionary_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -66,7 +66,7 @@ class UserDictionaryStorageTest : public ::testing::Test {
  protected:
   void SetUp() override {
     backup_user_profile_directory_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     FileUtil::Unlink(GetUserDictionaryFile());
   }
 
@@ -76,7 +76,7 @@ class UserDictionaryStorageTest : public ::testing::Test {
   }
 
   static std::string GetUserDictionaryFile() {
-    return FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "test.db");
+    return FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "test.db");
   }
 
  private:
@@ -217,7 +217,7 @@ TEST_F(UserDictionaryStorageTest, ExportTest) {
   }
 
   const std::string export_file =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "export.txt");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "export.txt");
 
   EXPECT_FALSE(storage.ExportDictionary(id + 1, export_file));
   EXPECT_TRUE(storage.ExportDictionary(id, export_file));
@@ -432,7 +432,7 @@ TEST_F(UserDictionaryStorageTest, ConvertSyncDictionariesToNormalDictionaries) {
 TEST_F(UserDictionaryStorageTest, Export) {
   const int kDummyDictionaryId = 10;
   const std::string kPath =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "exported_file");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "exported_file");
 
   {
     UserDictionaryStorage storage(GetUserDictionaryFile());
diff --git dictionary/user_dictionary_test.cc dictionary/user_dictionary_test.cc
index 1b1ea8b70..da3af7d32 100644
--- dictionary/user_dictionary_test.cc
+++ dictionary/user_dictionary_test.cc
@@ -38,7 +38,6 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/singleton.h"
@@ -59,6 +58,7 @@
 #include "testing/base/public/mozctest.h"
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 #include "absl/strings/string_view.h"
 
@@ -508,7 +508,7 @@ TEST_F(UserDictionaryTest, TestLookupExactWithSuggestionOnlyWords) {
 
   // Create dictionary
   const std::string filename = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "suggestion_only_test.db");
+      absl::GetFlag(FLAGS_test_tmpdir), "suggestion_only_test.db");
   FileUtil::Unlink(filename);
   UserDictionaryStorage storage(filename);
   {
@@ -571,7 +571,7 @@ TEST_F(UserDictionaryTest, IncognitoModeTest) {
 
 TEST_F(UserDictionaryTest, AsyncLoadTest) {
   const std::string filename = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "async_load_test.db");
+      absl::GetFlag(FLAGS_test_tmpdir), "async_load_test.db");
   FileUtil::Unlink(filename);
 
   // Create dictionary
@@ -624,7 +624,7 @@ TEST_F(UserDictionaryTest, TestSuppressionDictionary) {
   user_dic->WaitForReloader();
 
   const std::string filename = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "suppression_test.db");
+      absl::GetFlag(FLAGS_test_tmpdir), "suppression_test.db");
   FileUtil::Unlink(filename);
 
   UserDictionaryStorage storage(filename);
@@ -699,7 +699,7 @@ TEST_F(UserDictionaryTest, TestSuggestionOnlyWord) {
   user_dic->WaitForReloader();
 
   const std::string filename = FileUtil::JoinPath(
-      mozc::GetFlag(FLAGS_test_tmpdir), "suggestion_only_test.db");
+      absl::GetFlag(FLAGS_test_tmpdir), "suggestion_only_test.db");
   FileUtil::Unlink(filename);
 
   UserDictionaryStorage storage(filename);
diff --git engine/BUILD engine/BUILD
index 8527861ab..1ca71a3ea 100644
--- engine/BUILD
+++ engine/BUILD
@@ -79,11 +79,11 @@ cc_test_mozc(
     deps = [
         ":engine_builder",
         "//base:file_util",
-        "//base:flags",
         "//prediction:predictor_interface",
         "//protocol:engine_builder_proto",
         "//testing:gunit_main",
         "//testing:mozctest",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git engine/engine_builder_interface.h engine/engine_builder_interface.h
index 4c635e1b9..8e059e3bd 100644
--- engine/engine_builder_interface.h
+++ engine/engine_builder_interface.h
@@ -48,7 +48,7 @@ class EngineBuilderInterface {
 
   // Accepts data load request and sets |response->status()| to one of the
   // following values:
-  //   * ACCEPTED: Request is successfuly accepted.
+  //   * ACCEPTED: Request is successfully accepted.
   //   * ALREADY_RUNNING: The previous request is still being processed.
   virtual void PrepareAsync(const EngineReloadRequest &request,
                             EngineReloadResponse *response) = 0;
diff --git engine/engine_builder_test.cc engine/engine_builder_test.cc
index 6a5f65194..a5ff00e1c 100644
--- engine/engine_builder_test.cc
+++ engine/engine_builder_test.cc
@@ -32,11 +32,11 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "prediction/predictor_interface.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "testing/base/public/mozctest.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -83,11 +83,11 @@ TEST_F(EngineBuilderTest, PrepareAsync) {
     // Test request with install.  Since the requested file is moved,
     // |mock_data_path_| is copied to a temporary file.
     const std::string src_path =
-        FileUtil::JoinPath({mozc::GetFlag(FLAGS_test_tmpdir), "src.data"});
+        FileUtil::JoinPath({absl::GetFlag(FLAGS_test_tmpdir), "src.data"});
     ASSERT_TRUE(FileUtil::CopyFile(mock_data_path_, src_path));
 
     const std::string install_path =
-        FileUtil::JoinPath({mozc::GetFlag(FLAGS_test_tmpdir), "dst.data"});
+        FileUtil::JoinPath({absl::GetFlag(FLAGS_test_tmpdir), "dst.data"});
     request_.set_engine_type(EngineReloadRequest::MOBILE);
     request_.set_file_path(src_path);
     request_.set_install_location(install_path);
@@ -152,9 +152,9 @@ TEST_F(EngineBuilderTest, AsyncBuildWithInstall) {
       {EngineReloadRequest::MOBILE, "MobilePredictor"},
   };
   const std::string &tmp_src =
-      FileUtil::JoinPath({mozc::GetFlag(FLAGS_test_tmpdir), "src.data"});
+      FileUtil::JoinPath({absl::GetFlag(FLAGS_test_tmpdir), "src.data"});
   const std::string install_path =
-      FileUtil::JoinPath({mozc::GetFlag(FLAGS_test_tmpdir), "dst.data"});
+      FileUtil::JoinPath({absl::GetFlag(FLAGS_test_tmpdir), "dst.data"});
 
   for (const auto &test_case : kTestCases) {
     Clear();
diff --git gui/BUILD gui/BUILD
index e04879829..7dd39dfb8 100644
--- gui/BUILD
+++ gui/BUILD
@@ -28,23 +28,14 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-load("//:config.bzl", "BRANDING")
+load("//:build_defs.bzl", "info_plist_mozc")
 
 package(
     default_visibility = ["//gui:__subpackages__"],
 )
 
-genrule(
-    name = "gen_mozc_tool_info_plist",
-    srcs = [
-        "//base:mozc_version_txt",
-        "//data/mac:mozc_tool_info",
-    ],
+info_plist_mozc(
+    name = "mozc_tool_info_plist",
+    srcs = ["//data/mac:mozc_tool_info"],
     outs = ["mozc_tool_info.plist"],
-    cmd = ("$(location //build_tools:tweak_info_plist)" +
-           " --output $@" +
-           " --input $(location //data/mac:mozc_tool_info)" +
-           " --version_file $(location //base:mozc_version_txt)" +
-           " --branding " + BRANDING),
-    exec_tools = ["//build_tools:tweak_info_plist"],
 )
diff --git gui/config_dialog/config_dialog.h gui/config_dialog/config_dialog.h
index 14e1e6bf3..3627b9ca8 100644
--- gui/config_dialog/config_dialog.h
+++ gui/config_dialog/config_dialog.h
@@ -60,7 +60,7 @@ class ConfigDialog : public QDialog, private Ui::ConfigDialog {
   ConfigDialog();
   ~ConfigDialog() override;
 
-  // Methods defined in the 'slots' section (Qt's extention) will be processed
+  // Methods defined in the 'slots' section (Qt's extension) will be processed
   // by Qt's moc tool (moc.exe on Windows). Unfortunately, preprocessor macros
   // defined for C/C++ are not automatically passed into the moc tool.
   // For example, you need to call the moc tool with '-D' option as
diff --git gui/config_dialog/generic_table_editor.h gui/config_dialog/generic_table_editor.h
index d59695b66..d44ec03e3 100644
--- gui/config_dialog/generic_table_editor.h
+++ gui/config_dialog/generic_table_editor.h
@@ -70,7 +70,7 @@ class GenericTableEditorDialog : public QDialog,
   QTableWidget *mutable_table_widget();
   QMenu *mutable_edit_menu();
 
-  // impliments a method which returns default fileame
+  // implements a method which returns default fileame
   virtual std::string GetDefaultFilename() const = 0;
 
   // implements a method which loads
diff --git gui/config_dialog/keybinding_editor.h gui/config_dialog/keybinding_editor.h
index f08006ebc..b5f0d69ff 100644
--- gui/config_dialog/keybinding_editor.h
+++ gui/config_dialog/keybinding_editor.h
@@ -58,7 +58,7 @@ class KeyBindingEditor : public QDialog, private Ui::KeyBindingEditor {
   void SetBinding(const QString &binding);
 
   // For some reason, KeyBindingEditor lanuched by
-  // QItemDelegate looses focus. We overwrite
+  // QItemDelegate loses focus. We overwrite
   // setVisible() function to call raise() and activateWindow().
   void setVisible(bool visible) override {
     QWidget::setVisible(visible);
diff --git gui/config_dialog/keymap_editor.cc gui/config_dialog/keymap_editor.cc
index 8d329c633..48e62463e 100644
--- gui/config_dialog/keymap_editor.cc
+++ gui/config_dialog/keymap_editor.cc
@@ -104,7 +104,7 @@ class KeyMapValidator {
 #if defined(__APPLE__)
     // On Mac, we cannot customize keybindings for IME ON/OFF
     // So we do not show them.
-    // TODO(toshiyuki): remove them after implimenting IME ON/OFF for Mac
+    // TODO(toshiyuki): remove them after implementing IME ON/OFF for Mac
     invisible_commands_.insert(kIMEOnCommand);
     invisible_commands_.insert(kIMEOffCommand);
 #endif  // __APPLE__
diff --git gui/dictionary_tool/BUILD gui/dictionary_tool/BUILD
index f0987c52b..5030263b8 100644
--- gui/dictionary_tool/BUILD
+++ gui/dictionary_tool/BUILD
@@ -180,9 +180,9 @@ cc_qt_library_mozc(
     srcs = ["dictionary_tool_main.cc"],
     deps = [
         ":dictionary_tool",
-        "//base:flags",
         "//base:init_mozc",
         "//gui/base:gui_base",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git gui/dictionary_tool/dictionary_tool.h gui/dictionary_tool/dictionary_tool.h
index cc26021ed..0024cae94 100644
--- gui/dictionary_tool/dictionary_tool.h
+++ gui/dictionary_tool/dictionary_tool.h
@@ -126,7 +126,7 @@ class DictionaryTool : public QMainWindow, private Ui::DictionaryTool {
 
   // Show a dialog and get text for dictionary name from the user. The
   // first parameter is default text printed in a form. The second is
-  // message printed on the dialog. It returns an empty stirng
+  // message printed on the dialog. It returns an empty string
   // whenever a proper value for dictionary name is input.
   QString PromptForDictionaryName(const QString &text, const QString &label);
 
@@ -137,7 +137,7 @@ class DictionaryTool : public QMainWindow, private Ui::DictionaryTool {
   // These two functions are to start/stop monitoring data on the
   // table widget being changed. We validate the value on the widget
   // when the user edit it but the data can be modified
-  // programatically and validation is not necessary.
+  // programmatically and validation is not necessary.
   void StartMonitoringUserEdit();
   void StopMonitoringUserEdit();
 
@@ -155,7 +155,7 @@ class DictionaryTool : public QMainWindow, private Ui::DictionaryTool {
   // send Reload command to the server.
   void SaveAndReloadServer();
 
-  // 1. Shows a dialog box and get new |commnet|.
+  // 1. Shows a dialog box and get new |comment|.
   // 2. Changes the comemnt of all selected.
   void EditComment();
 
@@ -192,12 +192,12 @@ class DictionaryTool : public QMainWindow, private Ui::DictionaryTool {
   // not been saved.
   bool modified_;
 
-  // Holds information on whether dictionary entires are sorted, key
+  // Holds information on whether dictionary entries are sorted, key
   // column of sort and order of sort.
   //
   // Current implementation of sort may not be perfect. It doesn't
   // check if entries are already sorted when they are loaded nor
-  // whether modification is made keeping sorted entires sorted.
+  // whether modification is made keeping sorted entries sorted.
   struct SortState {
     bool sorted;
     int column;
diff --git gui/dictionary_tool/dictionary_tool_main.cc gui/dictionary_tool/dictionary_tool_main.cc
index c6701cb7f..cdf445431 100644
--- gui/dictionary_tool/dictionary_tool_main.cc
+++ gui/dictionary_tool/dictionary_tool_main.cc
@@ -27,8 +27,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
+#include "absl/flags/flag.h"
 
 #ifdef OS_WIN
 #include "base/winmain.h"
diff --git gui/error_message_dialog/BUILD gui/error_message_dialog/BUILD
index abc150ff4..9f85bcdd0 100644
--- gui/error_message_dialog/BUILD
+++ gui/error_message_dialog/BUILD
@@ -73,7 +73,6 @@ cc_qt_library_mozc(
     ],
     deps = [
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:process",
@@ -84,6 +83,7 @@ cc_qt_library_mozc(
         "//base:version",
         "//gui/base:gui_base",
         "//gui/base:singleton_window_helper",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git gui/error_message_dialog/error_message_dialog.cc gui/error_message_dialog/error_message_dialog.cc
index 87b344e60..9acf8fc8a 100644
--- gui/error_message_dialog/error_message_dialog.cc
+++ gui/error_message_dialog/error_message_dialog.cc
@@ -34,10 +34,10 @@
 #include <QtWidgets/QAbstractButton>
 #include <QtWidgets/QMessageBox>
 
-#include "base/flags.h"
 #include "gui/base/util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, error_type, "", "type of error");
+ABSL_FLAG(std::string, error_type, "", "type of error");
 
 namespace mozc {
 namespace gui {
@@ -82,36 +82,36 @@ void DeleyedMessageDialogHandler::EnableOkButton() {
 void ErrorMessageDialog::Show() {
   // defining all literal messages inside Show() method
   // for easy i18n/i10n
-  if (mozc::GetFlag(FLAGS_error_type) == "server_timeout") {
+  if (absl::GetFlag(FLAGS_error_type) == "server_timeout") {
     OnFatal(
         QObject::tr("Conversion engine is not responding. "
                     "Please restart this application."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "server_broken_message") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "server_broken_message") {
     OnFatal(QObject::tr(
         "Connecting to an incompatible conversion engine. "
         "Please restart your computer to enable [ProductName]. "
         "If this problem persists, please uninstall [ProductName] "
         "and install it again."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "server_version_mismatch") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "server_version_mismatch") {
     OnFatal(QObject::tr(
         "Conversion engine has been upgraded. "
         "Please restart this application to enable conversion engine. "
         "If the problem persists, please restart your computer."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "server_shutdown") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "server_shutdown") {
     OnFatal(
         QObject::tr("Conversion engine is killed unexceptionally. "
                     "Restarting the engine..."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "server_fatal") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "server_fatal") {
     OnFatal(
         QObject::tr("Cannot start conversion engine. "
                     "Please restart your computer."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "renderer_version_mismatch") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "renderer_version_mismatch") {
     OnFatal(
         QObject::tr("Candidate window renderer has been upgraded. "
                     "Please restart this application to enable new candidate "
                     "window renderer. "
                     "If the problem persists, please restart your computer."));
-  } else if (mozc::GetFlag(FLAGS_error_type) == "renderer_fatal") {
+  } else if (absl::GetFlag(FLAGS_error_type) == "renderer_fatal") {
     OnFatal(
         QObject::tr("Cannot start candidate window renderer. "
                     "Please restart your computer."));
diff --git gui/tool/BUILD gui/tool/BUILD
index a3beece3f..c6a358f72 100644
--- gui/tool/BUILD
+++ gui/tool/BUILD
@@ -40,11 +40,11 @@ cc_library_mozc(
     name = "prelauncher_lib",
     srcs = ["prelauncher_libmain.cc"],
     deps = [
-        "//base:flags",
         "//base:mac_util",
         "//client",
         "//client:client_interface",
         "//renderer:renderer_client",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -59,7 +59,7 @@ cc_qt_library_mozc(
     deps = [
         "//base:crash_report_handler",
         "//base:file_util",
-        "//base:flags",
+        "@com_google_absl//absl/flags:flag",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
diff --git gui/tool/mozc_tool.rc gui/tool/mozc_tool.rc
index b98f3a66a..ab446ce43 100644
Binary files gui/tool/mozc_tool.rc and gui/tool/mozc_tool.rc differ
diff --git gui/tool/mozc_tool_libmain.cc gui/tool/mozc_tool_libmain.cc
index 38cdda7c3..584465cf0 100644
--- gui/tool/mozc_tool_libmain.cc
+++ gui/tool/mozc_tool_libmain.cc
@@ -44,13 +44,14 @@
 
 #include "base/crash_report_handler.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/run_level.h"
 #include "base/util.h"
 #include "config/stats_config_util.h"
 #include "gui/base/debug_util.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
 #ifdef __APPLE__
 #include "base/const.h"
@@ -60,8 +61,8 @@
 #include "gui/base/win_util.h"
 #endif  // OS_WIN
 
-MOZC_FLAG(string, mode, "about_dialog", "mozc_tool mode");
-MOZC_DECLARE_FLAG(string, error_type);
+ABSL_FLAG(std::string, mode, "about_dialog", "mozc_tool mode");
+ABSL_DECLARE_FLAG(string, error_type);
 
 // Run* are defiend in each qt module
 int RunAboutDialog(int argc, char *argv[]);
@@ -87,12 +88,12 @@ namespace {
 void SetFlagsFromEnv() {
   const char *mode = std::getenv("FLAGS_mode");
   if (mode != nullptr) {
-    mozc::SetFlag(&FLAGS_mode, mode);
+    absl::SetFlag(&FLAGS_mode, mode);
   }
 
   const char *error_type = std::getenv("FLAGS_error_type");
   if (error_type != nullptr) {
-    mozc::SetFlag(&FLAGS_error_type, error_type);
+    absl::SetFlag(&FLAGS_error_type, error_type);
   }
 }
 
@@ -115,24 +116,24 @@ int RunMozcTool(int argc, char *argv[]) {
   // name.
   string binary_name = mozc::FileUtil::Basename(argv[0]);
   if (binary_name == "AboutDialog") {
-    mozc::SetFlag(&FLAGS_mode, "about_dialog");
+    absl::SetFlag(&FLAGS_mode, "about_dialog");
   } else if (binary_name == "ConfigDialog") {
-    mozc::SetFlag(&FLAGS_mode, "config_dialog");
+    absl::SetFlag(&FLAGS_mode, "config_dialog");
   } else if (binary_name == "DictionaryTool") {
-    mozc::SetFlag(&FLAGS_mode, "dictionary_tool");
+    absl::SetFlag(&FLAGS_mode, "dictionary_tool");
   } else if (binary_name == "ErrorMessageDialog") {
-    mozc::SetFlag(&FLAGS_mode, "error_message_dialog");
+    absl::SetFlag(&FLAGS_mode, "error_message_dialog");
   } else if (binary_name == "WordRegisterDialog") {
-    mozc::SetFlag(&FLAGS_mode, "word_register_dialog");
+    absl::SetFlag(&FLAGS_mode, "word_register_dialog");
   } else if (binary_name == kProductPrefix "Prelauncher") {
     // The binary name of prelauncher is user visible in
     // "System Preferences" -> "Accounts" -> "Login items".
     // So we set kProductPrefix to the binary name.
-    mozc::SetFlag(&FLAGS_mode, "prelauncher");
+    absl::SetFlag(&FLAGS_mode, "prelauncher");
   }
 #endif
 
-  if (mozc::GetFlag(FLAGS_mode) != "administration_dialog" &&
+  if (absl::GetFlag(FLAGS_mode) != "administration_dialog" &&
       !mozc::RunLevel::IsValidClientRunLevel()) {
     return -1;
   }
@@ -145,34 +146,34 @@ int RunMozcTool(int argc, char *argv[]) {
   mozc::gui::WinUtil::KeepJumpListUpToDate();
 #endif  // OS_WIN
 
-  if (mozc::GetFlag(FLAGS_mode) == "config_dialog") {
+  if (absl::GetFlag(FLAGS_mode) == "config_dialog") {
     return RunConfigDialog(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "dictionary_tool") {
+  } else if (absl::GetFlag(FLAGS_mode) == "dictionary_tool") {
     return RunDictionaryTool(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "word_register_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "word_register_dialog") {
     return RunWordRegisterDialog(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "error_message_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "error_message_dialog") {
     return RunErrorMessageDialog(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "about_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "about_dialog") {
     return RunAboutDialog(argc, argv);
 #ifdef OS_WIN
-  } else if (mozc::GetFlag(FLAGS_mode) == "set_default_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "set_default_dialog") {
     // set_default_dialog is used on Windows only.
     return RunSetDefaultDialog(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "post_install_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "post_install_dialog") {
     // post_install_dialog is used on Windows only.
     return RunPostInstallDialog(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "administration_dialog") {
+  } else if (absl::GetFlag(FLAGS_mode) == "administration_dialog") {
     // administration_dialog is used on Windows only.
     return RunAdministrationDialog(argc, argv);
 #endif  // OS_WIN
 #ifdef __APPLE__
-  } else if (mozc::GetFlag(FLAGS_mode) == "prelauncher") {
+  } else if (absl::GetFlag(FLAGS_mode) == "prelauncher") {
     // Prelauncher is used on Mac only.
     return RunPrelaunchProcesses(argc, argv);
 #endif  // __APPLE__
   } else {
-    LOG(ERROR) << "Unknown mode: " << mozc::GetFlag(FLAGS_mode);
+    LOG(ERROR) << "Unknown mode: " << absl::GetFlag(FLAGS_mode);
     return -1;
   }
 
diff --git gui/tool/prelauncher_libmain.cc gui/tool/prelauncher_libmain.cc
index d149eaf8f..39d677c4b 100644
--- gui/tool/prelauncher_libmain.cc
+++ gui/tool/prelauncher_libmain.cc
@@ -31,7 +31,7 @@
 
 #include <memory>
 
-#include "base/flags.h"
+#include "absl/flags/flag.h"
 #ifdef __APPLE__
 #include "base/mac_util.h"
 #endif  // __APPLE__
@@ -39,13 +39,13 @@
 #include "renderer/renderer_client.h"
 
 #ifdef __APPLE__
-MOZC_FLAG(bool, register_prelauncher, false,
+ABSL_FLAG(bool, register_prelauncher, false,
           "Register prelauncher to login item.");
 #endif  // __APPLE__
 
 int RunPrelaunchProcesses(int argc, char *argv[]) {
 #ifdef __APPLE__
-  if (mozc::GetFlag(FLAGS_register_prelauncher)) {
+  if (absl::GetFlag(FLAGS_register_prelauncher)) {
     mozc::MacUtil::AddPrelauncherLoginItem();
   }
 #endif  // __APPLE__
diff --git ios/BUILD ios/BUILD
index 719fa5e64..7461df3fa 100644
--- ios/BUILD
+++ ios/BUILD
@@ -42,7 +42,6 @@ cc_library_mozc(
     ],
     deps = [
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:mutex",
         "//base:port",
@@ -58,6 +57,7 @@ cc_library_mozc(
         "//session:session_handler",
         "//session:session_handler_interface",
         "@com_google_absl//absl/base:core_headers",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -67,11 +67,11 @@ cc_binary_mozc(
     data = ["//data_manager/google:mozc.data"],
     deps = [
         ":ios_engine",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:util",
         "//protocol:candidates_proto",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git ios/ios_engine.cc ios/ios_engine.cc
index ea915128f..d5314342d 100644
--- ios/ios_engine.cc
+++ ios/ios_engine.cc
@@ -33,7 +33,6 @@
 #include <string>
 #include <utility>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/mutex.h"
 #include "config/config_handler.h"
@@ -46,6 +45,7 @@
 #include "session/session.h"
 #include "session/session_handler.h"
 #include "session/session_handler_interface.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace ios {
@@ -169,7 +169,7 @@ IosEngine::InputConfigTuple IosEngine::GetInputConfigTupleFromLayoutName(
 void IosEngine::InitMozc() {
   // Output logs to stderr so that they are displayed in XCode's console.
   // This must be set before Logging::InitLogStream().
-  mozc::SetFlag(&FLAGS_logtostderr, true);
+  absl::SetFlag(&FLAGS_logtostderr, true);
   Logging::InitLogStream("MOZC_IOS_ENGINE");
 }
 
diff --git ios/ios_engine.h ios/ios_engine.h
index 934ffe398..dd93f1fa7 100644
--- ios/ios_engine.h
+++ ios/ios_engine.h
@@ -108,8 +108,8 @@ class IosEngine {
   //   * Another thread is using the underlying engine.
   // The second case is expected because this method is intended to be called by
   // a timer thread only when there's no key event for a while after a key press
-  // event is occured.  The use of underlying engine means some events have
-  // occured when the timer thread calls this method, so it's expected not to
+  // event is occurred.  The use of underlying engine means some events have
+  // occurred when the timer thread calls this method, so it's expected not to
   // send the special key to the engine.
   bool MaybeCreateNewChunk(commands::Command *command);
 
diff --git ios/ios_engine_main.cc ios/ios_engine_main.cc
index 21d6e5e71..d7724c6d5 100644
--- ios/ios_engine_main.cc
+++ ios/ios_engine_main.cc
@@ -31,17 +31,17 @@
 #include <iostream>
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "ios/ios_engine.h"
 #include "protocol/candidates.pb.h"
+#include "absl/flags/flag.h"
 
 // mozc/data_manager/testing:mozc_dataset_for_testing is one of datafile.
-MOZC_FLAG(string, datafile, "", "Path to a data file to be used");
-MOZC_FLAG(int32, candsize, 3, "Maximum number of candidates");
-MOZC_FLAG(bool, show_full, false, "Display the debug string of output command");
+ABSL_FLAG(std::string, datafile, "", "Path to a data file to be used");
+ABSL_FLAG(int32, candsize, 3, "Maximum number of candidates");
+ABSL_FLAG(bool, show_full, false, "Display the debug string of output command");
 
 namespace {
 
@@ -69,7 +69,7 @@ void Convert(const std::string &query, mozc::ios::IosEngine *engine,
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  mozc::ios::IosEngine ios_engine(mozc::GetFlag(FLAGS_datafile));
+  mozc::ios::IosEngine ios_engine(absl::GetFlag(FLAGS_datafile));
 
   mozc::commands::Command command;
   mozc::config::Config config;
@@ -97,13 +97,13 @@ int main(int argc, char **argv) {
 
     Convert(query, &ios_engine, &command);
 
-    if (mozc::GetFlag(FLAGS_show_full)) {
+    if (absl::GetFlag(FLAGS_show_full)) {
       std::cout << command.Utf8DebugString() << std::endl;
     } else {
       std::cout << "----- preedit -----\n"
                 << command.output().preedit().Utf8DebugString() << std::endl;
       const auto &cands = command.output().candidates();
-      const int size = std::min(mozc::GetFlag(FLAGS_candsize),
+      const int size = std::min(absl::GetFlag(FLAGS_candsize),
                                 cands.candidate_size());
       for (int i = 0; i < size; ++i) {
         std::cout << "----- candidate " << i << " -----\n"
diff --git ipc/BUILD ipc/BUILD
index f947ecf33..94fd5a445 100644
--- ipc/BUILD
+++ ipc/BUILD
@@ -130,7 +130,6 @@ cc_test_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:port",
         "//base:process_mutex",
         "//base:system_util",
@@ -138,6 +137,7 @@ cc_test_mozc(
         "//base:util",
         "//base:version",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -174,12 +174,12 @@ cc_test_mozc(
         ":ipc",
         ":ipc_test_util",
         "//base",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//base:thread",
         "//base:util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -221,12 +221,12 @@ cc_test_mozc(
         ":named_event",
         "//base",
         "//base:clock",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//base:thread",
         "//base:util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -268,12 +268,12 @@ cc_library_mozc(
 #     deps = [
 #         ":process_watch_dog",
 #         "//base",
-#         "//base:flags",
 #         "//base:init_mozc",
 #         "//base:logging",
 #         "//base:number_util",
 #         "//base:port",
 #         "//base:util",
+#         "@com_google_absl//absl/flags:flag",
 #     ],
 # )
 
diff --git ipc/ipc.h ipc/ipc.h
index 296656791..fe4c67128 100644
--- ipc/ipc.h
+++ ipc/ipc.h
@@ -184,7 +184,7 @@ class IPCClientFactoryInterface {
   virtual IPCClientInterface *NewClient(const std::string &name,
                                         const std::string &path_name) = 0;
 
-  // old interface for backward compatiblity.
+  // old interface for backward compatibility.
   // same as NewClient(name, "");
   virtual IPCClientInterface *NewClient(const std::string &name) = 0;
 };
@@ -194,11 +194,11 @@ class IPCClientFactory : public IPCClientFactoryInterface {
  public:
   ~IPCClientFactory() override;
 
-  // new inteface
+  // new interface
   IPCClientInterface *NewClient(const std::string &name,
                                 const std::string &path_name) override;
 
-  // old interface for backward compatiblity.
+  // old interface for backward compatibility.
   // same as NewClient(name, "");
   IPCClientInterface *NewClient(const std::string &name) override;
 
@@ -232,7 +232,7 @@ class IPCServer {
   IPCServer(const std::string &name, int32 num_connections, int32 timeout);
   virtual ~IPCServer();
 
-  // Return true if the connectoin is available
+  // Return true if the connection is available
   bool Connected() const;
 
   // Implement a server algorithm in subclass.
diff --git ipc/ipc_main.cc ipc/ipc_main.cc
index dc81d5eec..60df8b319 100644
--- ipc/ipc_main.cc
+++ ipc/ipc_main.cc
@@ -32,20 +32,20 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/thread.h"
 #include "ipc/ipc.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, server_address, "ipc_test", "");
-MOZC_FLAG(bool, test, false, "automatic test mode");
-MOZC_FLAG(bool, server, false, "invoke as server mode");
-MOZC_FLAG(bool, client, false, "invoke as client mode");
-MOZC_FLAG(string, server_path, "", "server path");
-MOZC_FLAG(int32, num_threads, 10, "number of threads");
-MOZC_FLAG(int32, num_requests, 100, "number of requests");
+ABSL_FLAG(std::string, server_address, "ipc_test", "");
+ABSL_FLAG(bool, test, false, "automatic test mode");
+ABSL_FLAG(bool, server, false, "invoke as server mode");
+ABSL_FLAG(bool, client, false, "invoke as client mode");
+ABSL_FLAG(std::string, server_path, "", "server path");
+ABSL_FLAG(int32, num_threads, 10, "number of threads");
+ABSL_FLAG(int32, num_requests, 100, "number of requests");
 
 namespace mozc {
 
@@ -53,9 +53,9 @@ class MultiConnections : public Thread {
  public:
   void Run() {
     char buf[8192];
-    for (int i = 0; i < mozc::GetFlag(FLAGS_num_requests); ++i) {
+    for (int i = 0; i < absl::GetFlag(FLAGS_num_requests); ++i) {
       mozc::IPCClient con(FLAGS_server_address,
-                          mozc::GetFlag(FLAGS_server_path));
+                          absl::GetFlag(FLAGS_server_path));
       CHECK(con.Connected());
       string input = "testtesttesttest";
       size_t length = sizeof(buf);
@@ -94,13 +94,13 @@ class EchoServerThread : public Thread {
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (mozc::GetFlag(FLAGS_test)) {
-    mozc::EchoServer con(mozc::GetFlag(FLAGS_server_address), 10, 1000);
+  if (absl::GetFlag(FLAGS_test)) {
+    mozc::EchoServer con(absl::GetFlag(FLAGS_server_address), 10, 1000);
     mozc::EchoServerThread server_thread_main(&con);
     server_thread_main.SetJoinable(true);
     server_thread_main.Start("IpcMain");
 
-    std::vector<mozc::MultiConnections> cons(mozc::GetFlag(FLAGS_num_threads));
+    std::vector<mozc::MultiConnections> cons(absl::GetFlag(FLAGS_num_threads));
     for (size_t i = 0; i < cons.size(); ++i) {
       cons[i].SetJoinable(true);
       cons[i].Start("MultiConnections");
@@ -110,7 +110,7 @@ int main(int argc, char **argv) {
     }
 
     mozc::IPCClient kill(FLAGS_server_address,
-                         mozc::GetFlag(FLAGS_server_path));
+                         absl::GetFlag(FLAGS_server_path));
     const char kill_cmd[32] = "kill";
     char output[32];
     size_t output_size = sizeof(output);
@@ -119,17 +119,17 @@ int main(int argc, char **argv) {
 
     LOG(INFO) << "Done";
 
-  } else if (mozc::GetFlag(FLAGS_server)) {
-    mozc::EchoServer con(mozc::GetFlag(FLAGS_server_address), 10, -1);
+  } else if (absl::GetFlag(FLAGS_server)) {
+    mozc::EchoServer con(absl::GetFlag(FLAGS_server_address), 10, -1);
     CHECK(con.Connected());
-    LOG(INFO) << "Start Server at " << mozc::GetFlag(FLAGS_server_address);
+    LOG(INFO) << "Start Server at " << absl::GetFlag(FLAGS_server_address);
     con.Loop();
-  } else if (mozc::GetFlag(FLAGS_client)) {
+  } else if (absl::GetFlag(FLAGS_client)) {
     string line;
     char response[8192];
     while (getline(cin, line)) {
       mozc::IPCClient con(FLAGS_server_address,
-                          mozc::GetFlag(FLAGS_server_path));
+                          absl::GetFlag(FLAGS_server_path));
       CHECK(con.Connected());
       size_t response_size = sizeof(response);
       CHECK(con.Call(line.data(), line.size(), response, &response_size, 1000));
diff --git ipc/ipc_path_manager_main.cc ipc/ipc_path_manager_main.cc
index 3317a812c..8fdf64985 100644
--- ipc/ipc_path_manager_main.cc
+++ ipc/ipc_path_manager_main.cc
@@ -29,34 +29,34 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "ipc/ipc_path_manager.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, client, false, "client mode");
-MOZC_FLAG(bool, server, false, "server mode");
-MOZC_FLAG(string, name, "test", "ipc name");
+ABSL_FLAG(bool, client, false, "client mode");
+ABSL_FLAG(bool, server, false, "server mode");
+ABSL_FLAG(std::string, name, "test", "ipc name");
 
 // command line tool to check the behavior of IPCPathManager
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
   mozc::IPCPathManager *manager =
-      mozc::IPCPathManager::GetIPCPathManager(mozc::GetFlag(FLAGS_name));
+      mozc::IPCPathManager::GetIPCPathManager(absl::GetFlag(FLAGS_name));
   CHECK(manager);
 
   string path;
 
-  if (mozc::GetFlag(FLAGS_client)) {
+  if (absl::GetFlag(FLAGS_client)) {
     CHECK(manager->GetPathName(&path));
     LOG(INFO) << "PathName: " << path;
     return 0;
   }
 
-  if (mozc::GetFlag(FLAGS_server)) {
+  if (absl::GetFlag(FLAGS_server)) {
     CHECK(manager->CreateNewPathName());
     CHECK(manager->SavePathName());
     CHECK(manager->GetPathName(&path));
diff --git ipc/ipc_path_manager_test.cc ipc/ipc_path_manager_test.cc
index 466bec00f..46f429094 100644
--- ipc/ipc_path_manager_test.cc
+++ ipc/ipc_path_manager_test.cc
@@ -38,7 +38,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/process_mutex.h"
 #include "base/system_util.h"
@@ -49,6 +48,7 @@
 #include "ipc/ipc.pb.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -87,7 +87,7 @@ class BatchGetPathNameThread : public Thread {
 class IPCPathManagerTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git ipc/ipc_test.cc ipc/ipc_test.cc
index a5ed6be6a..25f6c2b40 100644
--- ipc/ipc_test.cc
+++ ipc/ipc_test.cc
@@ -32,7 +32,6 @@
 #include <algorithm>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "base/thread.h"
@@ -40,6 +39,7 @@
 #include "ipc/ipc_test_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace {
 
@@ -117,7 +117,7 @@ class EchoServer : public mozc::IPCServer {
 }  // namespace
 
 TEST(IPCTest, IPCTest) {
-  mozc::SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  mozc::SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 #ifdef __APPLE__
   mozc::TestMachPortManager manager;
 #endif
diff --git ipc/named_event.h ipc/named_event.h
index 5985c4f0b..77959dc8a 100644
--- ipc/named_event.h
+++ ipc/named_event.h
@@ -47,7 +47,7 @@
 // Example:
 //
 // (Process 1)
-// NamedEventListener listner("foo");   // Create named event listener named foo
+// NamedEventListener listener("foo");  // Create named event listener named foo
 // CHECK(listener.IsAvailable());
 // listener.Wait(10000);  // Wait until an event comes.
 // Access shared resource
@@ -107,8 +107,8 @@ class NamedEventListener {
   // Return true if NamedEventListener is available
   bool IsAvailable() const;
 
-  // return true if NamedEventListner is created by this instance.
-  // If NamedEventListner opened an exiting handle, return false.
+  // return true if NamedEventListener is created by this instance.
+  // If NamedEventListener opened an exiting handle, return false.
   bool IsOwner() const;
 
   // Wait until the listener receives a notification
@@ -118,7 +118,7 @@ class NamedEventListener {
   bool Wait(int msec);
 
   // Wait until the listener receives a notification or
-  // the process specfied with pid is terminated.
+  // the process specified with pid is terminated.
   // return TIMEOUT: reached timeout
   // return EVENT_SIGNALED: event is signaled.
   // return PROCESS_SIGNALED: process is signaled.
diff --git ipc/named_event_main.cc ipc/named_event_main.cc
index bf95251a9..02d87d0de 100644
--- ipc/named_event_main.cc
+++ ipc/named_event_main.cc
@@ -29,39 +29,39 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "ipc/named_event.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, listener, true, "listener mode");
-MOZC_FLAG(bool, notifier, false, "notifier mode");
-MOZC_FLAG(int32, timeout, -1, "timeout (msec)");
-MOZC_FLAG(int32, pid, -1, "process id");
-MOZC_FLAG(string, name, "named_event_test", "name for named event");
+ABSL_FLAG(bool, listener, true, "listener mode");
+ABSL_FLAG(bool, notifier, false, "notifier mode");
+ABSL_FLAG(int32, timeout, -1, "timeout (msec)");
+ABSL_FLAG(int32, pid, -1, "process id");
+ABSL_FLAG(std::string, name, "named_event_test", "name for named event");
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (mozc::GetFlag(FLAGS_notifier)) {
-    mozc::NamedEventNotifier notifier(mozc::GetFlag(FLAGS_name).c_str());
+  if (absl::GetFlag(FLAGS_notifier)) {
+    mozc::NamedEventNotifier notifier(absl::GetFlag(FLAGS_name).c_str());
     CHECK(notifier.IsAvailable()) << "NamedEventNotifier is not available";
 
     notifier.Notify();
     LOG(INFO) << "Notification has been sent";
 
-  } else if (mozc::GetFlag(FLAGS_listener)) {
-    mozc::NamedEventListener listener(mozc::GetFlag(FLAGS_name).c_str());
+  } else if (absl::GetFlag(FLAGS_listener)) {
+    mozc::NamedEventListener listener(absl::GetFlag(FLAGS_name).c_str());
     CHECK(listener.IsAvailable()) << "NamedEventListener is not available";
 
     LOG_IF(INFO, listener.IsOwner()) << "This instance owns event handle";
 
-    LOG(INFO) << "Waiting event " << mozc::GetFlag(FLAGS_name);
-    if (mozc::GetFlag(FLAGS_pid) != -1) {
+    LOG(INFO) << "Waiting event " << absl::GetFlag(FLAGS_name);
+    if (absl::GetFlag(FLAGS_pid) != -1) {
       switch (listener.WaitEventOrProcess(
-          mozc::GetFlag(FLAGS_timeout),
-          static_cast<size_t>(mozc::GetFlag(FLAGS_pid)))) {
+          absl::GetFlag(FLAGS_timeout),
+          static_cast<size_t>(absl::GetFlag(FLAGS_pid)))) {
         case mozc::NamedEventListener::TIMEOUT:
           LOG(INFO) << "timeout";
           break;
@@ -76,7 +76,7 @@ int main(int argc, char **argv) {
           break;
       }
     } else {
-      if (listener.Wait(mozc::GetFlag(FLAGS_timeout))) {
+      if (listener.Wait(absl::GetFlag(FLAGS_timeout))) {
         LOG(INFO) << "Event comes";
       }
     }
diff --git ipc/named_event_test.cc ipc/named_event_test.cc
index aa7c629f6..a64ea8138 100644
--- ipc/named_event_test.cc
+++ ipc/named_event_test.cc
@@ -34,13 +34,13 @@
 #include <string>
 
 #include "base/clock.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "base/thread.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -87,7 +87,7 @@ class NamedEventListenerThread : public Thread {
 class NamedEventTest : public testing::Test {
   void SetUp() override {
     original_user_profile_directory_ = SystemUtil::GetUserProfileDirectory();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   void TearDown() override {
diff --git ipc/process_watch_dog_main.cc ipc/process_watch_dog_main.cc
index ee0ef0739..691c75114 100644
--- ipc/process_watch_dog_main.cc
+++ ipc/process_watch_dog_main.cc
@@ -31,15 +31,15 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/number_util.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "ipc/process_watch_dog.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(int32, timeout, -1, "set timeout");
+ABSL_FLAG(int32, timeout, -1, "set timeout");
 
 namespace mozc {
 class TestProcessWatchDog : public ProcessWatchDog {
@@ -75,7 +75,7 @@ int main(int argc, char **argv) {
 
     if (!dog.SetID(static_cast<mozc::ProcessWatchDog::ProcessID>(process_id),
                    static_cast<mozc::ProcessWatchDog::ThreadID>(thread_id),
-                   mozc::GetFlag(FLAGS_timeout))) {
+                   absl::GetFlag(FLAGS_timeout))) {
       std::cout << "Error" << std::endl;
     } else {
       std::cout << "OK" << std::endl;
diff --git ipc/win32_ipc.cc ipc/win32_ipc.cc
index c6f9fc889..d954a0f04 100644
--- ipc/win32_ipc.cc
+++ ipc/win32_ipc.cc
@@ -554,7 +554,7 @@ void IPCServer::Loop() {
                                       INFINITE, &overlapped, &ignored,
                                       &ipc_error, kReadTypeData)) {
           if (ipc_error == IPC_QUIT_EVENT_SIGNALED) {
-            VLOG(1) << "Recived Conrol event from other thread";
+            VLOG(1) << "Received Conrol event from other thread";
             connected_ = false;
             return;
           }
@@ -614,7 +614,7 @@ void IPCServer::Loop() {
     if (!RecvIPCMessage(pipe_handle_.get(), pipe_event_.get(), ack_request,
                         &ack_request_size, kAckTimeout, kReadTypeACK,
                         &last_ipc_error)) {
-      // This case happens when the client did not recive the server's response
+      // This case happens when the client did not receive the server's response
       // within timeout. Anyway we will close the connection so that the server
       // will not be blocked.
       LOG(WARNING) << "Client didn't respond within " << kAckTimeout
diff --git mac/BUILD mac/BUILD
index 5151898ff..54ee9ec39 100644
--- mac/BUILD
+++ mac/BUILD
@@ -28,11 +28,156 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-load("//:build_defs.bzl", "objc_library_mozc")
+load(
+    "//:build_defs.bzl",
+    "info_plist_mozc",
+    "macos_application_mozc",
+    "objc_library_mozc",
+    "py_binary_mozc",
+)
+load(
+    "//:config.bzl",
+    "BRANDING",
+    "MACOS_BUNDLE_ID_PREFIX",
+)
 
 package(default_visibility = ["//:__subpackages__"])
 
+macos_application_mozc(
+    name = "mozc_macos",
+    app_icons = ["//data/images/mac:product_icon.icns"],
+    bundle_id = MACOS_BUNDLE_ID_PREFIX,
+    bundle_name = BRANDING,
+    infoplists = [":info_plist"],
+    resources = [
+        "//data/images/mac:direct.tiff",
+        "//data/images/mac:full_ascii.tiff",
+        "//data/images/mac:full_katakana.tiff",
+        "//data/images/mac:half_ascii.tiff",
+        "//data/images/mac:half_katakana.tiff",
+        "//data/images/mac:hiragana.tiff",
+        "//data/installer:credits_en.html",
+    ],
+    deps = ["mozc_macos_main_lib"],
+)
+
 objc_library_mozc(
     name = "common",
     hdrs = ["common.h"],
 )
+
+objc_library_mozc(
+    name = "mozc_macos_main_lib",
+    srcs = ["main.mm"],
+    sdk_frameworks = ["InputMethodKit"],
+    deps = [
+        ":imk_controller",
+        ":imk_server",
+        "//base:crash_report_handler",
+        "//base:init_mozc",
+        "//base:logging",
+        "//base:run_level",
+        "//client",
+        "//config:stats_config_util",
+    ],
+)
+
+objc_library_mozc(
+    name = "imk_controller",
+    srcs = [
+        "GoogleJapaneseInputController.mm",
+    ],
+    hdrs = [
+        "GoogleJapaneseInputController.h",
+    ],
+    proto_deps = [
+        "//protocol:commands_proto",
+        "//protocol:config_proto",
+        "//protocol:renderer_proto",
+    ],
+    textual_hdrs = [
+        "GoogleJapaneseInputControllerInterface.h",
+    ],
+    deps = [
+        ":common",
+        ":imk_server",
+        ":keycode_map",
+        "//base:logging",
+        "//base:mac_process",
+        "//base:mac_util",
+        "//base:mutex",
+        "//base:util",
+        "//client",
+        "//ipc",
+        "//renderer:renderer_client",
+        "//session:ime_switch_util",
+    ],
+)
+
+objc_library_mozc(
+    name = "imk_server",
+    srcs = ["GoogleJapaneseInputServer.mm"],
+    hdrs = ["GoogleJapaneseInputServer.h"],
+    proto_deps = ["//protocol:commands_proto"],
+    deps = [
+        ":common",
+        "//base:logging",
+        "//base:mutex",
+    ],
+)
+
+objc_library_mozc(
+    name = "keycode_map",
+    srcs = ["KeyCodeMap.mm"],
+    hdrs = ["KeyCodeMap.h"],
+    proto_deps = ["//protocol:commands_proto"],
+    textual_hdrs = [
+        ":init_kanamap",
+        ":init_specialkeymap",
+        ":init_specialcharmap",
+    ],
+    deps = [
+        "//base:logging",
+        "//base:mutex",
+    ],
+)
+
+py_binary_mozc(
+    name = "generate_mapping",
+    srcs = ["generate_mapping.py"],
+    deps = [],
+)
+
+genrule(
+    name = "init_kanamap",
+    srcs = ["//data/preedit:mac-kana.tsv"],
+    outs = ["init_kanamap.h"],
+    cmd = ("$(location :generate_mapping) --mapname=KanaMap" +
+           " --result_type='const char *' --filename $< > $@"),
+    exec_tools = [":generate_mapping"],
+)
+
+genrule(
+    name = "init_specialkeymap",
+    srcs = ["//data/preedit:mac-specialkeys.tsv"],
+    outs = ["init_specialkeymap.h"],
+    cmd = ("$(location :generate_mapping) --mapname=SpecialKeyMap" +
+           " --result_type=KeyEvent::SpecialKey --filename $< > $@"),
+    exec_tools = [":generate_mapping"],
+)
+
+genrule(
+    name = "init_specialcharmap",
+    srcs = ["//data/preedit:mac-specialchars.tsv"],
+    outs = ["init_specialcharmap.h"],
+    cmd = ("$(location :generate_mapping) --mapname=SpecialCharMap" +
+           " --key_type=unichar --result_type=KeyEvent::SpecialKey" +
+           " --filename $< > $@"),
+    exec_tools = [":generate_mapping"],
+)
+
+info_plist_mozc(
+    name = "info_plist",
+    srcs = ["Info.plist"],
+    outs = [BRANDING + "Info.plist"],
+)
diff --git mac/GoogleJapaneseInputControllerInterface.h mac/GoogleJapaneseInputControllerInterface.h
index 62c9a5a8d..7d811ec0b 100644
--- mac/GoogleJapaneseInputControllerInterface.h
+++ mac/GoogleJapaneseInputControllerInterface.h
@@ -80,7 +80,7 @@
 
 // Set up the client capability
 - (void)setupCapability;
-// Set up the cilent bundle for the sender.
+// Set up the client bundle for the sender.
 - (void)setupClientBundle:(id)sender;
 
 // Launch the word register tool with the current selection range.
diff --git mac/GoogleJapaneseInputServer.mm mac/GoogleJapaneseInputServer.mm
index 4a668144e..041c6fa8b 100644
--- mac/GoogleJapaneseInputServer.mm
+++ mac/GoogleJapaneseInputServer.mm
@@ -29,8 +29,6 @@
 
 #import "mac/GoogleJapaneseInputServer.h"
 
-#import "mac/GoogleJapaneseInputController.h"
-
 #include <string>
 
 #include "base/const.h"
diff --git mac/Uninstaller/Uninstaller_main.mm mac/Uninstaller/Uninstaller_main.mm
index 4e4cd15b1..5d808ac9b 100644
--- mac/Uninstaller/Uninstaller_main.mm
+++ mac/Uninstaller/Uninstaller_main.mm
@@ -32,8 +32,8 @@
 #import "DialogsController.h"
 #import "Uninstaller.h"
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
+#include "absl/flags/flag.h"
 
 int main(int argc, char *argv[]) {
   mozc::InitMozc(argv[0], &argc, &argv);
diff --git mac/main.mm mac/main.mm
index c53be5fd3..a16eeb391 100644
--- mac/main.mm
+++ mac/main.mm
@@ -38,12 +38,12 @@
 
 #include "base/const.h"
 #include "base/crash_report_handler.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/run_level.h"
 #include "client/client.h"
 #include "config/stats_config_util.h"
+#include "absl/flags/flag.h"
 
 int main(int argc, char *argv[]) {
   if (!mozc::RunLevel::IsValidClientRunLevel()) {
diff --git prediction/BUILD prediction/BUILD
index de816004f..e4afa4f2f 100644
--- prediction/BUILD
+++ prediction/BUILD
@@ -77,7 +77,6 @@ cc_library_mozc(
         "//base",
         "//base:clock",
         "//base:config_file_stream",
-        "//base:flags",
         "//base:freelist",
         "//base:hash",
         "//base:logging",
@@ -99,6 +98,7 @@ cc_library_mozc(
         "//storage:lru_cache",
         "//testing:gunit_prod",
         "//usage_stats",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -117,7 +117,6 @@ cc_test_mozc(
         "//base:clock_mock",
         "//base:encryptor",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
@@ -137,6 +136,7 @@ cc_test_mozc(
         "//testing:gunit_main",
         "//usage_stats",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -153,7 +153,6 @@ cc_library_mozc(
         ":suggestion_filter",
         ":zero_query_dict",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:mozc_hash_map",
         "//base:number_util",
@@ -176,6 +175,7 @@ cc_library_mozc(
         "//request:conversion_request",
         "//testing:gunit_prod",
         "//usage_stats",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
     alwayslink = 1,
@@ -194,7 +194,6 @@ cc_test_mozc(
         ":suggestion_filter",
         ":zero_query_dict",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:serialized_string_array",
@@ -230,6 +229,7 @@ cc_test_mozc(
         "//transliteration",
         "//usage_stats",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -242,13 +242,13 @@ cc_library_mozc(
     deps = [
         ":predictor_interface",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//config:config_handler",
         "//converter:segments",
         "//protocol:commands_proto",
         "//protocol:config_proto",
         "//request:conversion_request",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
     alwayslink = 1,
@@ -330,12 +330,12 @@ cc_binary_mozc(
         "//base",
         "//base:codegen_bytearray_stream",
         "//base:file_stream",
-        "//base:flags",
         "//base:hash",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:util",
         "//storage:existence_filter",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git prediction/dictionary_predictor.cc prediction/dictionary_predictor.cc
index c3158b41b..8dd70a92a 100644
--- prediction/dictionary_predictor.cc
+++ prediction/dictionary_predictor.cc
@@ -40,7 +40,6 @@
 #include <utility>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/mozc_hash_map.h"
 #include "base/number_util.h"
@@ -61,6 +60,7 @@
 #include "protocol/config.pb.h"
 #include "request/conversion_request.h"
 #include "usage_stats/usage_stats.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
 #ifndef NDEBUG
@@ -233,7 +233,7 @@ class DictionaryPredictor::PredictiveLookupCallback
     // If the token is from user dictionary and its POS is unknown, it is
     // suggest-only words.  Such words are looked up only when their keys
     // exactly match |key|.  Otherwise, unigram suggestion can be annoying.  For
-    // example, suppose a user registers his/her email address as める.  Then,
+    // example, suppose a user registers their email address as める.  Then,
     // we don't want to show the email address from め but exactly from める.
     if ((token.attributes & Token::USER_DICTIONARY) != 0 &&
         token.lid == unknown_id_) {
diff --git prediction/dictionary_predictor_test.cc prediction/dictionary_predictor_test.cc
index 5d62e295c..d550d9630 100644
--- prediction/dictionary_predictor_test.cc
+++ prediction/dictionary_predictor_test.cc
@@ -37,7 +37,6 @@
 #include <utility>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/serialized_string_array.h"
@@ -76,6 +75,7 @@
 #include "transliteration/transliteration.h"
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 #include "absl/strings/string_view.h"
 
@@ -362,7 +362,7 @@ class MockTypingModel : public mozc::composer::TypingModel {
 class DictionaryPredictorTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     request_ = absl::make_unique<commands::Request>();
     config_ = absl::make_unique<config::Config>();
     config::ConfigHandler::GetDefaultConfig(config_.get());
@@ -2837,42 +2837,42 @@ TEST_F(DictionaryPredictorTest, SetLMCostForUserDictionaryWord) {
 
   {
     // Cost of words in user dictionary should be decreased.
-    const int kOrigianlWordCost = 10000;
+    const int kOriginalWordCost = 10000;
     std::vector<TestableDictionaryPredictor::Result> results;
     AddTestableDictionaryPredictorResult(
-        kAikaHiragana, kAikaKanji, kOrigianlWordCost,
+        kAikaHiragana, kAikaKanji, kOriginalWordCost,
         TestableDictionaryPredictor::UNIGRAM, Token::USER_DICTIONARY, &results);
 
     predictor->SetLMCost(segments, &results);
 
     EXPECT_EQ(1, results.size());
     EXPECT_EQ(kAikaKanji, results[0].value);
-    EXPECT_GT(kOrigianlWordCost, results[0].cost);
+    EXPECT_GT(kOriginalWordCost, results[0].cost);
     EXPECT_LE(1, results[0].cost);
   }
 
   {
     // Cost of words in user dictionary should not be decreased to below 1.
-    const int kOrigianlWordCost = 10;
+    const int kOriginalWordCost = 10;
     std::vector<TestableDictionaryPredictor::Result> results;
     AddTestableDictionaryPredictorResult(
-        kAikaHiragana, kAikaKanji, kOrigianlWordCost,
+        kAikaHiragana, kAikaKanji, kOriginalWordCost,
         TestableDictionaryPredictor::UNIGRAM, Token::USER_DICTIONARY, &results);
 
     predictor->SetLMCost(segments, &results);
 
     EXPECT_EQ(1, results.size());
     EXPECT_EQ(kAikaKanji, results[0].value);
-    EXPECT_GT(kOrigianlWordCost, results[0].cost);
+    EXPECT_GT(kOriginalWordCost, results[0].cost);
     EXPECT_LE(1, results[0].cost);
   }
 
   {
     // Cost of general symbols should not be decreased.
-    const int kOrigianlWordCost = 10000;
+    const int kOriginalWordCost = 10000;
     std::vector<TestableDictionaryPredictor::Result> results;
     AddTestableDictionaryPredictorResult(
-        kAikaHiragana, kAikaKanji, kOrigianlWordCost,
+        kAikaHiragana, kAikaKanji, kOriginalWordCost,
         TestableDictionaryPredictor::UNIGRAM, Token::USER_DICTIONARY, &results);
     ASSERT_EQ(1, results.size());
     results[0].lid = data_and_predictor->pos_matcher().GetGeneralSymbolId();
@@ -2881,22 +2881,22 @@ TEST_F(DictionaryPredictorTest, SetLMCostForUserDictionaryWord) {
 
     EXPECT_EQ(1, results.size());
     EXPECT_EQ(kAikaKanji, results[0].value);
-    EXPECT_LE(kOrigianlWordCost, results[0].cost);
+    EXPECT_LE(kOriginalWordCost, results[0].cost);
   }
 
   {
     // Cost of words not in user dictionary should not be decreased.
-    const int kOrigianlWordCost = 10000;
+    const int kOriginalWordCost = 10000;
     std::vector<TestableDictionaryPredictor::Result> results;
     AddTestableDictionaryPredictorResult(
-        kAikaHiragana, kAikaKanji, kOrigianlWordCost,
+        kAikaHiragana, kAikaKanji, kOriginalWordCost,
         TestableDictionaryPredictor::UNIGRAM, Token::NONE, &results);
 
     predictor->SetLMCost(segments, &results);
 
     EXPECT_EQ(1, results.size());
     EXPECT_EQ(kAikaKanji, results[0].value);
-    EXPECT_EQ(kOrigianlWordCost, results[0].cost);
+    EXPECT_EQ(kOriginalWordCost, results[0].cost);
   }
 }
 
diff --git prediction/gen_suggestion_filter_main.cc prediction/gen_suggestion_filter_main.cc
index bff0d615d..264e6d57c 100644
--- prediction/gen_suggestion_filter_main.cc
+++ prediction/gen_suggestion_filter_main.cc
@@ -33,17 +33,17 @@
 
 #include "base/codegen_bytearray_stream.h"
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/hash.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "storage/existence_filter.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, input, "", "per-line suggestion filter list");
-MOZC_FLAG(string, output, "", "output bloom filter");
-MOZC_FLAG(bool, header, true, "make header file instead of raw bloom filter");
-MOZC_FLAG(string, name, "SuggestionFilterData",
+ABSL_FLAG(std::string, input, "", "per-line suggestion filter list");
+ABSL_FLAG(std::string, output, "", "output bloom filter");
+ABSL_FLAG(bool, header, true, "make header file instead of raw bloom filter");
+ABSL_FLAG(std::string, name, "SuggestionFilterData",
           "name for variable name in the header file");
 
 namespace {
@@ -70,15 +70,15 @@ using mozc::storage::ExistenceFilter;
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if ((mozc::GetFlag(FLAGS_input).empty() ||
-       mozc::GetFlag(FLAGS_output).empty()) && argc > 2) {
-    mozc::SetFlag(&FLAGS_input, argv[1]);
-    mozc::SetFlag(&FLAGS_output, argv[2]);
+  if ((absl::GetFlag(FLAGS_input).empty() ||
+       absl::GetFlag(FLAGS_output).empty()) && argc > 2) {
+    absl::SetFlag(&FLAGS_input, argv[1]);
+    absl::SetFlag(&FLAGS_output, argv[2]);
   }
 
   std::vector<uint64> words;
 
-  ReadWords(mozc::GetFlag(FLAGS_input), &words);
+  ReadWords(absl::GetFlag(FLAGS_input), &words);
 
   LOG(INFO) << words.size() << " words found";
 
@@ -99,19 +99,19 @@ int main(int argc, char **argv) {
   char *buf = nullptr;
   size_t size = 0;
 
-  LOG(INFO) << "writing bloomfilter: " << mozc::GetFlag(FLAGS_output);
+  LOG(INFO) << "writing bloomfilter: " << absl::GetFlag(FLAGS_output);
   filter->Write(&buf, &size);
 
-  if (mozc::GetFlag(FLAGS_header)) {
-    mozc::OutputFileStream ofs(mozc::GetFlag(FLAGS_output).c_str());
+  if (absl::GetFlag(FLAGS_header)) {
+    mozc::OutputFileStream ofs(absl::GetFlag(FLAGS_output).c_str());
     mozc::CodeGenByteArrayOutputStream codegen_stream(
         &ofs, mozc::codegenstream::NOT_OWN_STREAM);
-    codegen_stream.OpenVarDef(mozc::GetFlag(FLAGS_name));
+    codegen_stream.OpenVarDef(absl::GetFlag(FLAGS_name));
     codegen_stream.write(buf, size);
     codegen_stream.CloseVarDef();
   } else {
     mozc::OutputFileStream ofs(
-        mozc::GetFlag(FLAGS_output).c_str(),
+        absl::GetFlag(FLAGS_output).c_str(),
         std::ios::out | std::ios::trunc | std::ios::binary);
     ofs.write(buf, size);
   }
diff --git prediction/predictor.cc prediction/predictor.cc
index 3937dc836..b7c0e8e28 100644
--- prediction/predictor.cc
+++ prediction/predictor.cc
@@ -34,11 +34,11 @@
 #include <utility>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "converter/segments.h"
 #include "protocol/commands.pb.h"
 #include "protocol/config.pb.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
diff --git prediction/predictor_test.cc prediction/predictor_test.cc
index 702b48d5e..de65565fd 100644
--- prediction/predictor_test.cc
+++ prediction/predictor_test.cc
@@ -202,7 +202,7 @@ TEST_F(MobilePredictorTest, CallPredictorsForMobilePartialPrediction) {
   EXPECT_TRUE(predictor->PredictForRequest(*convreq_, &segments));
 }
 
-TEST_F(MobilePredictorTest, CallPredictForRequetMobile) {
+TEST_F(MobilePredictorTest, CallPredictForRequestMobile) {
   auto predictor1 = absl::make_unique<MockPredictor>();
   auto predictor2 = absl::make_unique<MockPredictor>();
   EXPECT_CALL(*predictor1, PredictForRequest(_, _))
@@ -310,7 +310,7 @@ TEST_F(PredictorTest, CallPredictorsForPrediction) {
   EXPECT_TRUE(predictor->PredictForRequest(*convreq_, &segments));
 }
 
-TEST_F(PredictorTest, CallPredictForRequet) {
+TEST_F(PredictorTest, CallPredictForRequest) {
   auto predictor1 = absl::make_unique<MockPredictor>();
   auto predictor2 = absl::make_unique<MockPredictor>();
   EXPECT_CALL(*predictor1, PredictForRequest(_, _))
diff --git prediction/user_history_predictor.cc prediction/user_history_predictor.cc
index 4d5b64847..9c6712965 100644
--- prediction/user_history_predictor.cc
+++ prediction/user_history_predictor.cc
@@ -38,7 +38,6 @@
 
 #include "base/clock.h"
 #include "base/config_file_stream.h"
-#include "base/flags.h"
 #include "base/hash.h"
 #include "base/logging.h"
 #include "base/mozc_hash_set.h"
@@ -59,6 +58,7 @@
 #include "storage/encrypted_string_storage.h"
 #include "storage/lru_cache.h"
 #include "usage_stats/usage_stats.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -241,7 +241,7 @@ bool UserHistoryStorage::Load() {
       << num_deleted << " old entries were not loaded "
       << proto_.entries_size();
 
-  VLOG(1) << "Loaded user histroy, size=" << proto_.entries_size();
+  VLOG(1) << "Loaded user history, size=" << proto_.entries_size();
   return true;
 }
 
@@ -473,7 +473,7 @@ bool UserHistoryPredictor::Load(const UserHistoryStorage &history) {
                  history.GetProto().entries(i));
   }
 
-  VLOG(1) << "Loaded user histroy, size=" << history.GetProto().entries_size();
+  VLOG(1) << "Loaded user history, size=" << history.GetProto().entries_size();
 
   return true;
 }
diff --git prediction/user_history_predictor_test.cc prediction/user_history_predictor_test.cc
index 71e56c912..ef2f0bab6 100644
--- prediction/user_history_predictor_test.cc
+++ prediction/user_history_predictor_test.cc
@@ -35,7 +35,6 @@
 
 #include "base/clock_mock.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/password_manager.h"
 #include "base/port.h"
@@ -57,6 +56,7 @@
 #include "testing/base/public/gunit.h"
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 #include "absl/strings/string_view.h"
 
@@ -207,7 +207,7 @@ bool FindCandidateByValue(const std::string &value, const Segments &segments) {
 class UserHistoryPredictorTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     request_ = absl::make_unique<Request>();
     config_ = absl::make_unique<Config>();
     config::ConfigHandler::GetDefaultConfig(config_.get());
@@ -926,7 +926,7 @@ TEST_F(UserHistoryPredictorTest, HistoryToPunctuation) {
 
   Segments segments;
 
-  // Scenario 1: A user have commited "亜" by prediction and then commit "。".
+  // Scenario 1: A user have committed "亜" by prediction and then commit "。".
   // Then, the unigram "亜" is learned but the bigram "亜。" shouldn't.
   SetUpInputForPrediction("あ", composer_.get(), &segments);
   AddCandidate(0, "亜", &segments);
@@ -979,7 +979,7 @@ TEST_F(UserHistoryPredictorTest, HistoryToPunctuation) {
   EXPECT_EQ("お疲れ様です。", segments.segment(0).candidate(1).value);
 }
 
-TEST_F(UserHistoryPredictorTest, UserHistoryPredictorPreceedingPunctuation) {
+TEST_F(UserHistoryPredictorTest, UserHistoryPredictorPrecedingPunctuation) {
   UserHistoryPredictor *predictor = GetUserHistoryPredictorWithClearedHistory();
 
   Segments segments;
@@ -2002,7 +2002,7 @@ const bool kNonSensitive = false;
 
 const PrivacySensitiveTestData kNonSensitiveCases[] = {
     {kNonSensitive,  // We might want to revisit this behavior
-     "Type privacy sensitive number but it is commited as full-width number "
+     "Type privacy sensitive number but it is committed as full-width number "
      "by mistake.",
      "0007", "0007"},
     {kNonSensitive, "Type a ZIP number.", "100-0001", "東京都千代田区千代田"},
@@ -2237,7 +2237,7 @@ TEST_F(UserHistoryPredictorTest, UserHistoryStorageContainingOldEntries) {
   // Test Load().
   {
     const std::string filename =
-        FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testload");
+        FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testload");
     // Write directly to the file to keep old entries for testing.
     storage::EncryptedStringStorage file_storage(filename);
     ASSERT_TRUE(file_storage.Save(history.SerializeAsString()));
@@ -2256,7 +2256,7 @@ TEST_F(UserHistoryPredictorTest, UserHistoryStorageContainingOldEntries) {
   // Test Save().
   {
     const std::string filename =
-        FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "testsave");
+        FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "testsave");
     UserHistoryStorage storage(filename);
     storage.GetProto() = history;
     ASSERT_TRUE(storage.Save());
diff --git protocol/commands.proto protocol/commands.proto
index 403fdfa01..87f5ab5ad 100644
--- protocol/commands.proto
+++ protocol/commands.proto
@@ -310,7 +310,7 @@ message GenericStorageEntry {
   // Such byte stream cannot be treaed by Java's String class, which
   // is used for PB's string type.
   // Instead, PB's bytes type is converted into ByteString in Java,
-  // which can treat C laguage style string described above.
+  // which can treat C language style string described above.
   repeated bytes value = 3;
 }
 
@@ -361,7 +361,7 @@ message SessionCommand {
     // submitting segments from first one to focused one (inclusive).
     //
     // If no focused candidate (Suggestion, including ZeroQuery suggestion),
-    // first (and only) segment's candiadte of which id is equal to id field of
+    // first (and only) segment's candidate of which id is equal to id field of
     // Input message is submitted.
     // This behavior should be fixed because current cursor position affects
     // nothing. In future, the characters after the cursor should be kept
@@ -683,7 +683,7 @@ message Request {
     // input, the previous composition will be committed.  For
     // example, "ab<space>dc" results "ab " as a committed string and
     // "dc" as a composition.
-    SPACE_OR_CONVERT_COMMITING_COMPOSITION = 1;
+    SPACE_OR_CONVERT_COMMITTING_COMPOSITION = 1;
 
     // Commit the composition and a space.
     COMMIT = 2;
@@ -779,7 +779,7 @@ message Request {
     // cursor key, we'd like to commit the abcde and move the caret to right.
     // So the user will get:
     //   XXXXabcdeY|YYYY
-    // Here, what we need is commiting the "abcde" with the appropriate
+    // Here, what we need is committing the "abcde" with the appropriate
     // caret position. (Note that we need to handle the left cursor key, too).
     // Also, we should *NOT* consume the key, so that the key event will be
     // handled appropriately by the target application.
diff --git protocol/config.proto protocol/config.proto
index 56fd2f23b..8deb5a803 100644
--- protocol/config.proto
+++ protocol/config.proto
@@ -212,7 +212,7 @@ message Config {
   // auto IME turn off feature
   optional bool use_auto_ime_turn_off = 56 [default = true];
 
-  // Toggle to use cascanding window for debuging.
+  // Toggle to use cascanding window for debugging.
   optional bool use_cascading_window = 58 [default = true];
 
   // Shift key mode switch
diff --git protocol/engine_builder.proto protocol/engine_builder.proto
index 90b5f3bb3..1b73b0bb4 100644
--- protocol/engine_builder.proto
+++ protocol/engine_builder.proto
@@ -72,7 +72,7 @@ message EngineReloadResponse {
 
     // The following are errors.
 
-    // Failed to start reload becuase another reload job is currently running.
+    // Failed to start reload because another reload job is currently running.
     ALREADY_RUNNING = 3;
 
     // Erros in data file.
diff --git protocol/renderer_command.proto protocol/renderer_command.proto
index 80ef98c03..27da46cd8 100644
--- protocol/renderer_command.proto
+++ protocol/renderer_command.proto
@@ -155,7 +155,7 @@ message RendererCommand {
     // HWND of the window where composition is displayed.
     optional uint32 target_window_handle = 4;
     // used in Windows:
-    // Preffered font for composition string.
+    // Preferred font for composition string.
     optional WinLogFont composition_font = 5;
 
     // Represents IM Framework used in the client.
@@ -185,7 +185,7 @@ message RendererCommand {
 
     // used in Windows:
     // Indicates if a UI element is expected to be displayed or not.  Note
-    // taht |RendererCommand::visible| should be prior to these flags, that is,
+    // that |RendererCommand::visible| should be prior to these flags, that is,
     // you should hide all UI elements if |RendererCommand::visible| is false
     // regardless of the visibility specified in this field.
     enum UIVisibility {
diff --git protocol/user_dictionary_storage.proto protocol/user_dictionary_storage.proto
index 4fdc7019e..ee47cd554 100644
--- protocol/user_dictionary_storage.proto
+++ protocol/user_dictionary_storage.proto
@@ -92,7 +92,7 @@ message UserDictionary {
 
   // set false if this dictionary is not used.
   // Even if |enabled| is false, the dictionary
-  // it self is visible to user.
+  // itself is visible to user.
   optional bool enabled = 2 [default = true];
 
   // name of dictionary
@@ -284,7 +284,7 @@ message UserDictionaryCommandStatus {
     FILE_NOT_FOUND = 6;
     INVALID_FILE_FORMAT = 7;
 
-    // Note: currently if we recieve this error status,
+    // Note: currently if we receive this error status,
     // the file is actually saved.
     FILE_SIZE_LIMIT_EXCEEDED = 8;
     DICTIONARY_SIZE_LIMIT_EXCEEDED = 9;
diff --git renderer/BUILD renderer/BUILD
index 0d905fcbf..bf71b05eb 100644
--- renderer/BUILD
+++ renderer/BUILD
@@ -33,6 +33,8 @@ load(
     "cc_binary_mozc",
     "cc_library_mozc",
     "cc_test_mozc",
+    "info_plist_mozc",
+    "macos_application_mozc",
     "objc_library_mozc",
     "select_mozc",
 )
@@ -40,9 +42,7 @@ load(
     "//:config.bzl",
     "BRANDING",
     "MACOS_BUNDLE_ID_PREFIX",
-    "MACOS_MIN_OS_VER",
 )
-load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application")
 
 package(default_visibility = ["//:__subpackages__"])
 
@@ -101,7 +101,6 @@ cc_library_mozc(
     deps = [
         ":renderer_interface",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
@@ -113,6 +112,7 @@ cc_library_mozc(
         "//ipc:process_watch_dog",
         "//protocol:config_proto",
         "//protocol:renderer_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -128,7 +128,6 @@ cc_test_mozc(
         ":renderer_interface",
         ":renderer_server",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
@@ -136,6 +135,7 @@ cc_test_mozc(
         "//ipc:ipc_test_util",
         "//protocol:renderer_proto",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -310,7 +310,7 @@ cc_binary_mozc(
     deps = [
         ":mozc_renderer_lib",
         "//base:crash_report_handler",
-        "//base:flags",
+        "@com_google_absl//absl/flags:flag",
         "//base:init_mozc",
         "//base:run_level",
         "//base:system_util",
@@ -364,13 +364,12 @@ cc_test_mozc(
 )
 
 # macOS
-macos_application(
+macos_application_mozc(
     name = "mozc_renderer_macos",
     app_icons = ["//data/images/mac:product_icon.icns"],
     bundle_id = MACOS_BUNDLE_ID_PREFIX + ".Renderer",
     bundle_name = BRANDING + "Renderer",
-    infoplists = [":gen_mozc_renderer_info_plist"],
-    minimum_os_version = MACOS_MIN_OS_VER,
+    infoplists = [":mozc_renderer_info_plist"],
     resources = ["//data/images/mac:candidate_window_logo.tiff"],
     deps = [":mozc_renderer_main_macos"],
     # When we support Breakpad, uncomment the following block.
@@ -385,12 +384,12 @@ cc_library_mozc(
     deps = [
         ":mozc_renderer_lib_macos",
         "//base:crash_report_handler",
-        "//base:flags",
         "//base:init_mozc",
         "//base:run_level",
         "//base:system_util",
         "//base:util",
         "//config:stats_config_util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -448,17 +447,8 @@ objc_library_mozc(
     ]),
 )
 
-genrule(
-    name = "gen_mozc_renderer_info_plist",
-    srcs = [
-        "mac/Info.plist",
-        "//base:mozc_version_txt",
-    ],
+info_plist_mozc(
+    name = "mozc_renderer_info_plist",
+    srcs = ["mac/Info.plist"],
     outs = ["Info.plist"],
-    cmd = ("$(location //build_tools:tweak_info_plist)" +
-           " --output $@" +
-           " --input $(location mac/Info.plist)" +
-           " --version_file $(location //base:mozc_version_txt)" +
-           " --branding " + BRANDING),
-    exec_tools = ["//build_tools:tweak_info_plist"],
 )
diff --git renderer/mac/CandidateController.mm renderer/mac/CandidateController.mm
index 587f432e1..f6c6ee741 100644
--- renderer/mac/CandidateController.mm
+++ renderer/mac/CandidateController.mm
@@ -239,7 +239,7 @@ int GetBaseScreenHeight() {
   const mozc::Rect display_rect = GetNearestDisplayRect(preedit_rect);
 
   // Align candidate window.
-  // Initialize the the position.  We use (left, bottom) of preedit as
+  // Initialize the position.  We use (left, bottom) of preedit as
   // the top-left position of the window because we want to show the
   // window just below of the preedit.
   const TableLayout *candidate_layout = candidate_window_->GetTableLayout();
diff --git renderer/mozc_renderer.rc renderer/mozc_renderer.rc
index bf07eb278..962b84b80 100644
Binary files renderer/mozc_renderer.rc and renderer/mozc_renderer.rc differ
diff --git renderer/mozc_renderer_main.cc renderer/mozc_renderer_main.cc
index 61fa81d7c..4aa5c9bf2 100644
--- renderer/mozc_renderer_main.cc
+++ renderer/mozc_renderer_main.cc
@@ -34,12 +34,13 @@
 #endif  // OS_WIN, ENABLE_GTK_RENDERER
 
 #include "base/crash_report_handler.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/run_level.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "config/stats_config_util.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
 #ifdef OS_WIN
 #include "base/win_util.h"
@@ -64,7 +65,7 @@
 #include "renderer/unix/window_manager.h"
 #endif  // OS_WIN, __APPLE__, ENABLE_GTK_RENDERER
 
-MOZC_DECLARE_FLAG(bool, restricted);
+ABSL_DECLARE_FLAG(bool, restricted);
 
 int main(int argc, char *argv[]) {
   const mozc::RunLevel::RunLevelType run_level =
@@ -91,7 +92,7 @@ int main(int argc, char *argv[]) {
 
   // restricted mode
   if (run_level == mozc::RunLevel::RESTRICTED) {
-    mozc::SetFlag(&FLAGS_restricted, true);
+    absl::SetFlag(&FLAGS_restricted, true);
   }
 
   if (mozc::config::StatsConfigUtil::IsEnabled()) {
diff --git renderer/renderer_client.h renderer/renderer_client.h
index 25ca55ef2..4a063c1e0 100644
--- renderer/renderer_client.h
+++ renderer/renderer_client.h
@@ -57,7 +57,7 @@ class RendererLauncherInterface {
   // do not use this method unless protocol version mismatch
   virtual bool ForceTerminateRenderer(const std::string &name) = 0;
 
-  // called when fatal error occured
+  // called when fatal error occurred
   virtual void OnFatal(RendererErrorType type) = 0;
 
   // return true if the renderer is running
diff --git renderer/renderer_server.cc renderer/renderer_server.cc
index fcbed2d54..b57dec26d 100644
--- renderer/renderer_server.cc
+++ renderer/renderer_server.cc
@@ -37,7 +37,6 @@
 
 #include "base/compiler_specific.h"
 #include "base/const.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/system_util.h"
@@ -49,12 +48,13 @@
 #include "protocol/config.pb.h"
 #include "protocol/renderer_command.pb.h"
 #include "renderer/renderer_interface.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 // By default, mozc_renderer quits when user-input continues to be
 // idle for 10min.
-MOZC_FLAG(int32, timeout, 10 * 60, "timeout of candidate server (sec)");
-MOZC_FLAG(bool, restricted, false,
+ABSL_FLAG(int32, timeout, 10 * 60, "timeout of candidate server (sec)");
+ABSL_FLAG(bool, restricted, false,
           "launch candidates server with restricted mode");
 
 namespace mozc {
@@ -174,14 +174,14 @@ RendererServer::RendererServer()
       send_command_(new RendererServerSendCommand) {
   watch_dog_ = absl::make_unique<ParentApplicationWatchDog>(this);
   watch_dog_->StartWatchDog();
-  if (mozc::GetFlag(FLAGS_restricted)) {
-    mozc::SetFlag(&FLAGS_timeout,
+  if (absl::GetFlag(FLAGS_restricted)) {
+    absl::SetFlag(&FLAGS_timeout,
                   // set 60sec with restricted mode
-                  std::min(mozc::GetFlag(FLAGS_timeout), 60));
+                  std::min(absl::GetFlag(FLAGS_timeout), 60));
   }
 
   timeout_ = 1000 * std::max(3, std::min(24 * 60 * 60,
-                                         mozc::GetFlag(FLAGS_timeout)));
+                                         absl::GetFlag(FLAGS_timeout)));
   VLOG(2) << "timeout is set to be : " << timeout_;
 
 #ifndef MOZC_NO_LOGGING
diff --git renderer/renderer_server_test.cc renderer/renderer_server_test.cc
index e0540cdcb..8f209a611 100644
--- renderer/renderer_server_test.cc
+++ renderer/renderer_server_test.cc
@@ -32,7 +32,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/system_util.h"
@@ -43,6 +42,7 @@
 #include "renderer/renderer_interface.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace renderer {
@@ -121,12 +121,12 @@ class DummyRendererLauncher : public RendererLauncherInterface {
 class RendererServerTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
 TEST_F(RendererServerTest, IPCTest) {
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   mozc::IPCClientFactoryOnMemory on_memory_client_factory;
 
   std::unique_ptr<TestRendererServer> server(new TestRendererServer);
diff --git renderer/unix/candidate_window_test.cc renderer/unix/candidate_window_test.cc
index 3bedcf1f7..506ec1188 100644
--- renderer/unix/candidate_window_test.cc
+++ renderer/unix/candidate_window_test.cc
@@ -60,7 +60,7 @@ namespace renderer {
 namespace gtk {
 
 namespace {
-// Following variable is used testing and it is contant but due to API
+// Following variable is used testing and it is constant but due to API
 // restriction, can not modify const modifier.
 GtkWidget *kDummyWindow = reinterpret_cast<GtkWidget *>(0x12345678);
 GtkWidget *kDummyCanvas = reinterpret_cast<GtkWidget *>(0x87654321);
@@ -1395,7 +1395,7 @@ TEST_F(CandidateWindowTest, OnMouseLeftUpTest) {
     FinalizeTestKit(&testkit);
   }
   {
-    SCOPED_TRACE("Exepcted ID will be set by candidate index.");
+    SCOPED_TRACE("Expected ID will be set by candidate index.");
     const size_t kTestRound = 10;
     for (size_t i = 0; i < kTestRound; ++i) {
       SendCommandInterfaceMock interface_mock;
diff --git renderer/unix/draw_tool_interface.h renderer/unix/draw_tool_interface.h
index 266d53eee..b9d22d7df 100644
--- renderer/unix/draw_tool_interface.h
+++ renderer/unix/draw_tool_interface.h
@@ -58,7 +58,7 @@ class DrawToolInterface {
   virtual void Save() = 0;
   virtual void Restore() = 0;
 
-  // Draws rectangle and fill inside of it with spcified color.
+  // Draws rectangle and fill inside of it with specified color.
   virtual void FillRect(const Rect &rect, const RGBA &color) = 0;
 
   // Draws rectangle with specified color.
diff --git renderer/unix/gtk_window_base_test.cc renderer/unix/gtk_window_base_test.cc
index 35f066367..67b9897ca 100644
--- renderer/unix/gtk_window_base_test.cc
+++ renderer/unix/gtk_window_base_test.cc
@@ -44,7 +44,7 @@ namespace renderer {
 namespace gtk {
 
 namespace {
-// Following variable is used testing and it is contant but due to API
+// Following variable is used testing and it is constant but due to API
 // restriction, can not modify const modifier.
 GtkWidget *kDummyWindow = reinterpret_cast<GtkWidget *>(0x12345678);
 GtkWidget *kDummyCanvas = reinterpret_cast<GtkWidget *>(0x87654321);
diff --git renderer/unix/infolist_window.h renderer/unix/infolist_window.h
index fe182534a..e717ac1f9 100644
--- renderer/unix/infolist_window.h
+++ renderer/unix/infolist_window.h
@@ -78,13 +78,13 @@ class InfolistWindow : public GtkWindowBase {
 
   void Draw();
 
-  // Draws specified description row and returns it's height.
+  // Draws specified description row and returns its height.
   int DrawRow(int row, int ypos);
 
   // Gets target rendering rects.
   RenderingRowRects GetRowRects(int row, int ypos);
 
-  // Draws caption string and returns it's height.
+  // Draws caption string and returns its height.
   int DrawCaption();
 
   // Draws infolist window frame line.
diff --git renderer/unix/infolist_window_test.cc renderer/unix/infolist_window_test.cc
index 540ce2943..98be2cb23 100644
--- renderer/unix/infolist_window_test.cc
+++ renderer/unix/infolist_window_test.cc
@@ -49,7 +49,7 @@ namespace renderer {
 namespace gtk {
 
 namespace {
-// Following variable is used testing and it is contant but due to API
+// Following variable is used testing and it is constant but due to API
 // restriction, can not modify const modifier.
 GtkWidget *kDummyWindow = reinterpret_cast<GtkWidget *>(0x12345678);
 GtkWidget *kDummyCanvas = reinterpret_cast<GtkWidget *>(0x87654321);
diff --git renderer/unix/unix_renderer_test.cc renderer/unix/unix_renderer_test.cc
index fc9f954ae..0c1c98fed 100644
--- renderer/unix/unix_renderer_test.cc
+++ renderer/unix/unix_renderer_test.cc
@@ -69,7 +69,7 @@ TEST(UnixRendererTest, ExecCommand) {
     EXPECT_FALSE(renderer.ExecCommand(command));
   }
   {
-    SCOPED_TRACE("UPDATE with visibile = true update layout");
+    SCOPED_TRACE("UPDATE with visible = true update layout");
 
     WindowManagerMock *wm_mock = new WindowManagerMock();
     commands::RendererCommand command;
@@ -83,7 +83,7 @@ TEST(UnixRendererTest, ExecCommand) {
     EXPECT_TRUE(renderer.ExecCommand(command));
   }
   {
-    SCOPED_TRACE("UPDATE with visibile = false call HideAllWindows");
+    SCOPED_TRACE("UPDATE with visible = false call HideAllWindows");
 
     WindowManagerMock *wm_mock = new WindowManagerMock();
     commands::RendererCommand command;
diff --git renderer/unix/unix_server.h renderer/unix/unix_server.h
index e152f38da..7a100320f 100644
--- renderer/unix/unix_server.h
+++ renderer/unix/unix_server.h
@@ -67,9 +67,9 @@ class UnixServer : public RendererServer {
   Mutex mutex_;
   std::unique_ptr<GtkWrapperInterface> gtk_;
 
-  // Following pipe is used to communicate IPC recieving thread and
+  // Following pipe is used to communicate IPC receiving thread and
   // rendering(gtk-main) thread. The gtk-main loop polls following pipe and IPC
-  // recieving thread writes small data to notify gtk-main thread to update when
+  // receiving thread writes small data to notify gtk-main thread to update when
   // new packet is arrived.
   int pipefd_[2];
 
diff --git renderer/unix/unix_server_test.cc renderer/unix/unix_server_test.cc
index 1324a97e2..d11cc3963 100644
--- renderer/unix/unix_server_test.cc
+++ renderer/unix/unix_server_test.cc
@@ -29,11 +29,11 @@
 
 #include "renderer/unix/unix_server.h"
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "renderer/unix/gtk_wrapper_mock.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 using testing::_;
 using testing::Return;
@@ -46,7 +46,7 @@ namespace gtk {
 class UnixServerTest : public testing::Test {
  protected:
   virtual void SetUp() {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git renderer/win32/gen_pbgra32_bitmap.cc renderer/win32/gen_pbgra32_bitmap.cc
index fa3376794..58fbf4f6c 100644
--- renderer/win32/gen_pbgra32_bitmap.cc
+++ renderer/win32/gen_pbgra32_bitmap.cc
@@ -34,14 +34,14 @@
 #include <memory>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, src, "", "path to the input PNG file");
-MOZC_FLAG(string, dest, "", "path to the output BMP file");
+ABSL_FLAG(std::string, src, "", "path to the input PNG file");
+ABSL_FLAG(std::string, dest, "", "path to the output BMP file");
 
 using ::std::max;
 using ::std::min;
@@ -61,7 +61,7 @@ const uint32 kMaxBitmapHeight = 16384;
 
 bool ConvertMain() {
   std::wstring wide_src;
-  mozc::Util::UTF8ToWide(mozc::GetFlag(FLAGS_src), &wide_src);
+  mozc::Util::UTF8ToWide(absl::GetFlag(FLAGS_src), &wide_src);
   std::unique_ptr<Gdiplus::Bitmap> image(
       Gdiplus::Bitmap::FromFile(wide_src.c_str()));
 
@@ -119,7 +119,7 @@ bool ConvertMain() {
   header.pixel_data_size = pixel_data_bytes;
 
   mozc::OutputFileStream output_file(
-      mozc::GetFlag(FLAGS_dest).c_str(),
+      absl::GetFlag(FLAGS_dest).c_str(),
       std::ios::out | std::ios::binary | std::ios::trunc);
   if (!output_file.good()) {
     return false;
@@ -145,11 +145,11 @@ bool ConvertMain() {
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (mozc::GetFlag(FLAGS_src).empty()) {
+  if (absl::GetFlag(FLAGS_src).empty()) {
     std::cout << "Specify --src option";
     return kErrorLevelFail;
   }
-  if (mozc::GetFlag(FLAGS_dest).empty()) {
+  if (absl::GetFlag(FLAGS_dest).empty()) {
     std::cout << "Specify --dest option";
     return kErrorLevelFail;
   }
diff --git renderer/win32/win32_renderer_client.cc renderer/win32/win32_renderer_client.cc
index 400865117..bcfe7f9fb 100644
--- renderer/win32/win32_renderer_client.cc
+++ renderer/win32/win32_renderer_client.cc
@@ -55,7 +55,7 @@ Mutex *g_mutex = nullptr;
 // Represents the module handle of this module.
 volatile HMODULE g_module = nullptr;
 
-// True if the the DLL received DLL_PROCESS_DETACH notification.
+// True if the DLL received DLL_PROCESS_DETACH notification.
 volatile bool g_module_unloaded = false;
 
 // Represents the number of UI threads that are recognized by this module.
diff --git rewriter/BUILD rewriter/BUILD
index 84ca5e340..ae183e7d5 100644
--- rewriter/BUILD
+++ rewriter/BUILD
@@ -60,7 +60,6 @@ cc_test_mozc(
     deps = [
         ":merger_rewriter",
         "//base",
-        "//base:flags",
         "//base:stl_util",
         "//base:system_util",
         "//config:config_handler",
@@ -69,6 +68,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -83,7 +83,6 @@ cc_library_mozc(
         ":collocation_util",
         ":rewriter_interface",
         "//base",
-        "//base:flags",
         "//base:hash",
         "//base:logging",
         "//base:port",
@@ -94,6 +93,7 @@ cc_library_mozc(
         "//protocol:commands_proto",
         "//request:conversion_request",
         "//storage:existence_filter",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -107,7 +107,6 @@ cc_test_mozc(
     deps = [
         ":collocation_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//config:config_handler",
@@ -115,6 +114,7 @@ cc_test_mozc(
         "//dictionary:pos_matcher_lib",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -162,7 +162,6 @@ cc_test_mozc(
         "//base:clock",
         "//base:clock_mock",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:number_util",
         "//base:system_util",
@@ -177,6 +176,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -190,7 +190,6 @@ cc_library_mozc(
         "//base",
         "//base:config_file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:util",
@@ -202,6 +201,7 @@ cc_library_mozc(
         "//request:conversion_request",
         "//storage:lru_storage",
         "//usage_stats",
+        "@com_google_absl//absl/flags:flag",
     ],
     alwayslink = 1,
 )
@@ -215,7 +215,6 @@ cc_test_mozc(
         ":user_boundary_history_rewriter",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:system_util",
         "//config:config_handler",
         "//converter:converter_mock",
@@ -223,6 +222,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -467,7 +467,6 @@ cc_test_mozc(
     requires_full_emulation = False,
     deps = [
         ":version_rewriter",
-        "//base:flags",
         "//base:system_util",
         "//base:util",
         "//config:config_handler",
@@ -475,6 +474,7 @@ cc_test_mozc(
         "//protocol:commands_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -514,7 +514,6 @@ cc_test_mozc(
     deps = [
         ":symbol_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//base:util",
@@ -527,6 +526,7 @@ cc_test_mozc(
         "//request:conversion_request",
         "//session:request_test_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -647,12 +647,12 @@ cc_test_mozc(
     deps = [
         ":english_variants_rewriter",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//converter:segments",
         "//protocol:commands_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -683,12 +683,12 @@ cc_test_mozc(
     deps = [
         ":fortune_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//converter:segments",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -717,11 +717,11 @@ cc_test_mozc(
     deps = [
         ":dice_rewriter",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//converter:segments",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -755,7 +755,6 @@ cc_test_mozc(
     deps = [
         ":calculator_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//config:config_handler",
@@ -770,6 +769,7 @@ cc_test_mozc(
         "//rewriter/calculator",
         "//rewriter/calculator:calculator_mock",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -802,7 +802,6 @@ cc_test_mozc(
     deps = [
         ":unicode_rewriter",
         "//base",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//base:util",
@@ -815,6 +814,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -844,13 +844,13 @@ cc_test_mozc(
     deps = [
         ":user_dictionary_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//base:util",
         "//converter:segments",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -894,12 +894,12 @@ cc_binary_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:util",
         "//data_manager",
         "//data_manager:serialized_dictionary",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -909,12 +909,12 @@ cc_binary_mozc(
     deps = [
         ":rewriter_interface",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:mozc_hash_map",
         "//base:util",
         "//data_manager:serialized_dictionary",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -1042,10 +1042,10 @@ cc_binary_mozc(
     name = "gen_single_kanji_noun_prefix_data",
     srcs = ["gen_single_kanji_noun_prefix_data.cc"],
     deps = [
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:port",
         "//data_manager:serialized_dictionary",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1056,7 +1056,6 @@ cc_test_mozc(
     requires_full_emulation = False,
     deps = [
         ":single_kanji_rewriter",
-        "//base:flags",
         "//base:system_util",
         "//base:util",
         "//config:config_handler",
@@ -1067,6 +1066,7 @@ cc_test_mozc(
         "//request:conversion_request",
         "//session:request_test_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -1122,7 +1122,6 @@ cc_test_mozc(
     deps = [
         ":focus_candidate_rewriter",
         "//base",
-        "//base:flags",
         "//base:number_util",
         "//base:system_util",
         "//config:config_handler",
@@ -1130,6 +1129,7 @@ cc_test_mozc(
         "//data_manager/testing:mock_data_manager",
         "//testing:gunit_main",
         "//transliteration",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -1243,7 +1243,6 @@ cc_test_mozc(
     deps = [
         ":command_rewriter",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//config:config_handler",
         "//converter:segments",
@@ -1251,6 +1250,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1278,11 +1278,11 @@ cc_test_mozc(
     deps = [
         ":normalization_rewriter",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//converter:segments",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -1322,11 +1322,11 @@ cc_binary_mozc(
     deps = [
         "//base",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:serialized_string_array",
         "//base:util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
@@ -1367,7 +1367,6 @@ cc_test_mozc(
         ":rewriter_interface",
         ":usage_rewriter",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//config:config_handler",
         "//converter:segments",
@@ -1381,6 +1380,7 @@ cc_test_mozc(
         "//protocol:config_proto",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
     ],
@@ -1484,7 +1484,6 @@ cc_library_mozc(
         ":version_rewriter",
         ":zipcode_rewriter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//converter:converter_interface",
@@ -1492,6 +1491,7 @@ cc_library_mozc(
         "//dictionary:dictionary_interface",
         "//dictionary:pos_group",
         "//dictionary:pos_matcher_lib",
+        "@com_google_absl//absl/flags:flag",
     ],
     alwayslink = 1,
 )
@@ -1532,7 +1532,6 @@ cc_test_mozc(
         "rewriter",
         ":rewriter_interface",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//config:config_handler",
         "//converter:converter_mock",
@@ -1541,6 +1540,7 @@ cc_test_mozc(
         "//dictionary:pos_group",
         "//request:conversion_request",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -1588,9 +1588,9 @@ cc_binary_mozc(
     deps = [
         ":gen_existence_data",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -1600,10 +1600,10 @@ cc_binary_mozc(
     deps = [
         ":gen_existence_data",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc_buildtool",
         "//base:logging",
         "//base:util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git rewriter/calculator/calculator_test.cc rewriter/calculator/calculator_test.cc
index 299107812..16c50311b 100644
--- rewriter/calculator/calculator_test.cc
+++ rewriter/calculator/calculator_test.cc
@@ -85,7 +85,7 @@ TEST(CalculatorTest, BasicTest) {
   // These are not expressions
   // apparently
   VerifyRejection(calculator, "test");
-  // Expressoin must be ended with equal '='.
+  // Expression must be ended with equal '='.
   VerifyRejection(calculator, "5+4");
   // Expression must include at least one operator other than parentheses.
   VerifyRejection(calculator, "111=");
diff --git rewriter/calculator_rewriter_test.cc rewriter/calculator_rewriter_test.cc
index f34401cf7..01daa68ca 100644
--- rewriter/calculator_rewriter_test.cc
+++ rewriter/calculator_rewriter_test.cc
@@ -32,7 +32,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
@@ -48,6 +47,7 @@
 #include "rewriter/calculator/calculator_mock.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -116,7 +116,7 @@ class CalculatorRewriterTest : public ::testing::Test {
   }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
     // use mock
     CalculatorFactory::SetCalculator(&calculator_mock_);
diff --git rewriter/collocation_rewriter.cc rewriter/collocation_rewriter.cc
index 913fac238..ecc3943c9 100644
--- rewriter/collocation_rewriter.cc
+++ rewriter/collocation_rewriter.cc
@@ -34,7 +34,6 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/hash.h"
 #include "base/logging.h"
 #include "base/util.h"
@@ -44,11 +43,12 @@
 #include "request/conversion_request.h"
 #include "rewriter/collocation_util.h"
 #include "storage/existence_filter.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(bool, use_collocation, true, "use collocation rewrite");
+ABSL_FLAG(bool, use_collocation, true, "use collocation rewrite");
 
 namespace mozc {
 
@@ -261,7 +261,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
   const size_t aux_value_len = Util::CharsLen(aux_value);
   const size_t value_len = Util::CharsLen(value);
 
-  // "<XXいる|>" can be rewrited to "<YY|いる>" and vice versa
+  // "<XXいる|>" can be rewrote to "<YY|いる>" and vice versa
   {
     static const char kPat[] = "いる";  // "いる"
     const absl::string_view kSuffix(kPat, arraysize(kPat) - 1);
@@ -286,7 +286,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
     }
   }
 
-  // "<XXせる|>" can be rewrited to "<YY|せる>" and vice versa
+  // "<XXせる|>" can be rewrote to "<YY|せる>" and vice versa
   {
     const char kPat[] = "せる";
     const absl::string_view kSuffix(kPat, arraysize(kPat) - 1);
@@ -313,7 +313,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
 
   const Util::ScriptType content_script_type = Util::GetScriptType(content);
 
-  // "<XX|する>" can be rewrited using "<XXす|る>" and "<XX|する>"
+  // "<XX|する>" can be rewrote using "<XXす|る>" and "<XX|する>"
   // in "<XX|する>", XX must be single script type
   {
     static const char kPat[] = "する";
@@ -334,7 +334,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
     }
   }
 
-  // "<XXる>" can be rewrited using "<XX|る>"
+  // "<XXる>" can be rewrote using "<XX|る>"
   // "まとめる", "衰える"
   {
     static const char kPat[] = "る";
@@ -349,7 +349,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
     }
   }
 
-  // "<XXす>" can be rewrited using "XXする"
+  // "<XXす>" can be rewrote using "XXする"
   {
     static const char kPat[] = "す";
     const absl::string_view kSuffix(kPat, arraysize(kPat) - 1);
@@ -366,7 +366,7 @@ bool IsNaturalContent(const Segment::Candidate &cand,
     }
   }
 
-  // "<XXし|た>" can be rewrited using "<XX|した>"
+  // "<XXし|た>" can be rewrote using "<XX|した>"
   {
     static const char kPat[] = "した";
     const absl::string_view kShi(kPat, 3), kTa(kPat + 3, 3);
@@ -448,7 +448,7 @@ bool CollocationRewriter::RewriteCollocation(Segments *segments) const {
 
   for (size_t i = segments->history_segments_size();
        i < segments->segments_size(); ++i) {
-    bool rewrited_next = false;
+    bool rewrote_next = false;
 
     if (IsKeyUnknown(segments->segment(i))) {
       continue;
@@ -458,12 +458,12 @@ bool CollocationRewriter::RewriteCollocation(Segments *segments) const {
         RewriteUsingNextSegment(segments->mutable_segment(i + 1),
                                 segments->mutable_segment(i))) {
       changed = true;
-      rewrited_next = true;
+      rewrote_next = true;
       segs_changed[i] = true;
       segs_changed[i + 1] = true;
     }
 
-    if (!segs_changed[i] && !rewrited_next && i > 0 &&
+    if (!segs_changed[i] && !rewrote_next && i > 0 &&
         RewriteFromPrevSegment(segments->segment(i - 1).candidate(0),
                                segments->mutable_segment(i))) {
       changed = true;
@@ -566,7 +566,7 @@ CollocationRewriter::~CollocationRewriter() {}
 
 bool CollocationRewriter::Rewrite(const ConversionRequest &request,
                                   Segments *segments) const {
-  if (!mozc::GetFlag(FLAGS_use_collocation)) {
+  if (!absl::GetFlag(FLAGS_use_collocation)) {
     return false;
   }
   return RewriteCollocation(segments);
diff --git rewriter/collocation_rewriter_test.cc rewriter/collocation_rewriter_test.cc
index 62c08f8b4..14295dc04 100644
--- rewriter/collocation_rewriter_test.cc
+++ rewriter/collocation_rewriter_test.cc
@@ -33,7 +33,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
@@ -42,6 +41,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -80,7 +80,7 @@ class CollocationRewriterTest : public ::testing::Test {
   ~CollocationRewriterTest() override = default;
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
     const mozc::testing::MockDataManager data_manager;
     pos_matcher_.Set(data_manager.GetPOSMatcherData());
diff --git rewriter/command_rewriter_test.cc rewriter/command_rewriter_test.cc
index e5b2d7e2c..21c3e26f1 100644
--- rewriter/command_rewriter_test.cc
+++ rewriter/command_rewriter_test.cc
@@ -31,7 +31,6 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "converter/segments.h"
@@ -40,6 +39,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -73,7 +73,7 @@ class CommandRewriterTest : public ::testing::Test {
   }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     config::ConfigHandler::GetDefaultConfig(&config_);
     request_.Clear();
   }
diff --git rewriter/date_rewriter_test.cc rewriter/date_rewriter_test.cc
index d1f4a9eda..d40256b19 100644
--- rewriter/date_rewriter_test.cc
+++ rewriter/date_rewriter_test.cc
@@ -269,7 +269,7 @@ TEST_F(DateRewriterTest, DateRewriteTest) {
                                      "4月18日",
                                      "月曜日"};
 
-    // If initial count of candidate is 1, date rewrited candidate start from 1.
+    // If initial count of candidate is 1, date rewrote candidate start from 1.
     // "きょう", "今日"
     InitSegment("きょう", "今日", &segments);
     EXPECT_TRUE(rewriter.Rewrite(request, &segments));
@@ -282,7 +282,7 @@ TEST_F(DateRewriterTest, DateRewriteTest) {
     }
 
     // If initial count of candidate is 5 and target candidate is located at
-    // index 4, date rewrited candidate start from 5.
+    // index 4, date rewrote candidate start from 5.
     // "きょう", "今日"
     InitSegment("きょう", "今日", &segments);
 
@@ -303,7 +303,7 @@ TEST_F(DateRewriterTest, DateRewriteTest) {
     }
 
     // If initial count of candidate is 5 and target candidate is located at
-    // index 0, date rewrited candidate start from kMinimumDateCandidateIdx.
+    // index 0, date rewrote candidate start from kMinimumDateCandidateIdx.
     // "きょう", "今日"
     InitSegment("きょう", "今日", &segments);
 
diff --git rewriter/dice_rewriter_test.cc rewriter/dice_rewriter_test.cc
index c1d15baab..69d2c5638 100644
--- rewriter/dice_rewriter_test.cc
+++ rewriter/dice_rewriter_test.cc
@@ -32,12 +32,12 @@
 #include <cstddef>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "converter/segments.h"
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -111,7 +111,7 @@ size_t GetDiceNumberIndex(const Segment &segment) {
 class DiceRewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git rewriter/emoticon_rewriter.cc rewriter/emoticon_rewriter.cc
index 32524c842..442447afb 100644
--- rewriter/emoticon_rewriter.cc
+++ rewriter/emoticon_rewriter.cc
@@ -75,7 +75,7 @@ void InsertCandidates(SerializedDictionary::const_iterator begin,
                       size_t initial_insert_pos, size_t initial_insert_size,
                       bool is_no_learning, Segment *segment) {
   if (segment->candidates_size() == 0) {
-    LOG(WARNING) << "candiadtes_size is 0";
+    LOG(WARNING) << "candidates_size is 0";
     return;
   }
 
@@ -90,7 +90,7 @@ void InsertCandidates(SerializedDictionary::const_iterator begin,
 
   std::sort(sorted_value.begin(), sorted_value.end(), ValueCostCompare());
 
-  // after sorting the valeus by |cost|, adjacent candidates
+  // after sorting the values by |cost|, adjacent candidates
   // will have the same value. It is almost OK to use std::unique to
   // remove dup entries, it is not a perfect way though.
   sorted_value.erase(
diff --git rewriter/english_variants_rewriter.cc rewriter/english_variants_rewriter.cc
index f701397a2..b5a15cbd9 100644
--- rewriter/english_variants_rewriter.cc
+++ rewriter/english_variants_rewriter.cc
@@ -120,7 +120,7 @@ bool EnglishVariantsRewriter::ExpandEnglishVariantsWithSegment(
     DCHECK(original_candidate);
 
     // http://b/issue?id=5137299
-    // If the entry is comming from user dictionary,
+    // If the entry is coming from user dictionary,
     // expand English variants.
     if (original_candidate->attributes &
             Segment::Candidate::NO_VARIANTS_EXPANSION &&
diff --git rewriter/english_variants_rewriter_test.cc rewriter/english_variants_rewriter_test.cc
index f8cb95778..7f803c6dc 100644
--- rewriter/english_variants_rewriter_test.cc
+++ rewriter/english_variants_rewriter_test.cc
@@ -32,20 +32,20 @@
 #include <cstddef>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "converter/segments.h"
 #include "protocol/commands.pb.h"
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
 class EnglishVariantsRewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   bool GetRankFromValue(const Segment &segment, const std::string &value,
diff --git rewriter/focus_candidate_rewriter.cc rewriter/focus_candidate_rewriter.cc
index 019df99f0..00266bc0b 100644
--- rewriter/focus_candidate_rewriter.cc
+++ rewriter/focus_candidate_rewriter.cc
@@ -51,7 +51,7 @@ bool IsConnectorSegment(const Segment &segment) {
   return (segment.key() == "と" || segment.key() == "や");
 }
 
-// Finds value from the candidates list and move the canidate to the top.
+// Finds value from the candidates list and move the candidate to the top.
 bool RewriteCandidate(Segment *segment, const std::string &value) {
   for (int i = 0; i < segment->candidates_size(); ++i) {
     if (segment->candidate(i).content_value == value) {
diff --git rewriter/focus_candidate_rewriter.h rewriter/focus_candidate_rewriter.h
index b2c1b874b..e592f269c 100644
--- rewriter/focus_candidate_rewriter.h
+++ rewriter/focus_candidate_rewriter.h
@@ -73,7 +73,7 @@ class FocusCandidateRewriter : public RewriterInterface {
                              absl::string_view ref_suffix) const;
 
   // Parses the value of a candidate into number and counter suffix.
-  // Simultaneously checks the script type of number.  Here, number candiate is
+  // Simultaneously checks the script type of number.  Here, number candidate is
   // defined to be the following pattern:
   //   * [数][助数詞][並立助詞]?  (e.g., 一階, 二回, 3階や, etc.)
   // Returns false if the value of candidate doesn't match the pattern.
diff --git rewriter/focus_candidate_rewriter_test.cc rewriter/focus_candidate_rewriter_test.cc
index df9d47b63..a92d5fcce 100644
--- rewriter/focus_candidate_rewriter_test.cc
+++ rewriter/focus_candidate_rewriter_test.cc
@@ -33,7 +33,6 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/number_util.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
@@ -42,6 +41,7 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "transliteration/transliteration.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -67,7 +67,7 @@ void AddCandidateWithContentValue(Segment *segment, const std::string &value,
 class FocusCandidateRewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     rewriter_ = absl::make_unique<FocusCandidateRewriter>(&mock_data_manager_);
   }
 
diff --git rewriter/fortune_rewriter_test.cc rewriter/fortune_rewriter_test.cc
index 48186d906..00231e504 100644
--- rewriter/fortune_rewriter_test.cc
+++ rewriter/fortune_rewriter_test.cc
@@ -32,13 +32,13 @@
 #include <cstddef>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "converter/segments.h"
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -74,7 +74,7 @@ bool HasFortune(const Segments &segments) {
 class FortuneRewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git rewriter/gen_collocation_data_main.cc rewriter/gen_collocation_data_main.cc
index bcb99debb..b4fe04a03 100644
--- rewriter/gen_collocation_data_main.cc
+++ rewriter/gen_collocation_data_main.cc
@@ -41,21 +41,21 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "rewriter/gen_existence_data.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, collocation_data, "", "collocation data text");
-MOZC_FLAG(string, output, "", "output file name (default: stdout)");
-MOZC_FLAG(double, error_rate, 0.00001, "error rate");
-MOZC_FLAG(bool, binary_mode, false, "outputs binary file");
+ABSL_FLAG(std::string, collocation_data, "", "collocation data text");
+ABSL_FLAG(std::string, output, "", "output file name (default: stdout)");
+ABSL_FLAG(double, error_rate, 0.00001, "error rate");
+ABSL_FLAG(bool, binary_mode, false, "outputs binary file");
 
 namespace mozc {
 namespace {
 
 void Convert() {
-  InputFileStream ifs(mozc::GetFlag(FLAGS_collocation_data).c_str());
+  InputFileStream ifs(absl::GetFlag(FLAGS_collocation_data).c_str());
   std::string line;
   std::vector<std::string> entries;
   while (!std::getline(ifs, line).fail()) {
@@ -66,21 +66,21 @@ void Convert() {
   }
 
   std::ostream *ofs = &std::cout;
-  if (!mozc::GetFlag(FLAGS_output).empty()) {
-    if (mozc::GetFlag(FLAGS_binary_mode)) {
-      ofs = new OutputFileStream(mozc::GetFlag(FLAGS_output).c_str(),
+  if (!absl::GetFlag(FLAGS_output).empty()) {
+    if (absl::GetFlag(FLAGS_binary_mode)) {
+      ofs = new OutputFileStream(absl::GetFlag(FLAGS_output).c_str(),
                                  std::ios::out | std::ios::binary);
     } else {
-      ofs = new OutputFileStream(mozc::GetFlag(FLAGS_output).c_str());
+      ofs = new OutputFileStream(absl::GetFlag(FLAGS_output).c_str());
     }
   }
 
-  if (mozc::GetFlag(FLAGS_binary_mode)) {
-    OutputExistenceBinary(entries, ofs, mozc::GetFlag(FLAGS_error_rate));
+  if (absl::GetFlag(FLAGS_binary_mode)) {
+    OutputExistenceBinary(entries, ofs, absl::GetFlag(FLAGS_error_rate));
   } else {
     const std::string kNameSpace = "CollocationData";
     OutputExistenceHeader(entries, kNameSpace, ofs,
-                          mozc::GetFlag(FLAGS_error_rate));
+                          absl::GetFlag(FLAGS_error_rate));
   }
 
   if (ofs != &std::cout) {
@@ -93,11 +93,11 @@ void Convert() {
 int main(int argc, char *argv[]) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (mozc::GetFlag(FLAGS_collocation_data).empty() && argc > 1) {
-    mozc::SetFlag(&FLAGS_collocation_data, argv[1]);
+  if (absl::GetFlag(FLAGS_collocation_data).empty() && argc > 1) {
+    absl::SetFlag(&FLAGS_collocation_data, argv[1]);
   }
 
-  LOG(INFO) << mozc::GetFlag(FLAGS_collocation_data);
+  LOG(INFO) << absl::GetFlag(FLAGS_collocation_data);
 
   mozc::Convert();
 
diff --git rewriter/gen_collocation_suppression_data_main.cc rewriter/gen_collocation_suppression_data_main.cc
index 0d14199d3..3a44da990 100644
--- rewriter/gen_collocation_suppression_data_main.cc
+++ rewriter/gen_collocation_suppression_data_main.cc
@@ -44,16 +44,16 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "rewriter/gen_existence_data.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, suppression_data, "", "suppression data text");
-MOZC_FLAG(string, output, "", "output file name (default: stdout)");
-MOZC_FLAG(double, error_rate, 0.00001, "error rate");
-MOZC_FLAG(bool, binary_mode, false, "outputs binary file");
+ABSL_FLAG(std::string, suppression_data, "", "suppression data text");
+ABSL_FLAG(std::string, output, "", "output file name (default: stdout)");
+ABSL_FLAG(double, error_rate, 0.00001, "error rate");
+ABSL_FLAG(bool, binary_mode, false, "outputs binary file");
 
 namespace mozc {
 namespace {
@@ -62,11 +62,11 @@ void Convert() {
   const char kSeparator[] = "\t";
   std::vector<std::string> entries;
 
-  if (mozc::GetFlag(FLAGS_suppression_data).empty()) {
+  if (absl::GetFlag(FLAGS_suppression_data).empty()) {
     const std::string kDummyStr = "__NO_DATA__";
     entries.push_back(kDummyStr + kSeparator + kDummyStr);
   } else {
-    InputFileStream ifs(mozc::GetFlag(FLAGS_suppression_data).c_str());
+    InputFileStream ifs(absl::GetFlag(FLAGS_suppression_data).c_str());
     std::string line;
 
     while (!std::getline(ifs, line).fail()) {
@@ -81,21 +81,21 @@ void Convert() {
   }
 
   std::ostream *ofs = &std::cout;
-  if (!mozc::GetFlag(FLAGS_output).empty()) {
-    if (mozc::GetFlag(FLAGS_binary_mode)) {
-      ofs = new OutputFileStream(mozc::GetFlag(FLAGS_output).c_str(),
+  if (!absl::GetFlag(FLAGS_output).empty()) {
+    if (absl::GetFlag(FLAGS_binary_mode)) {
+      ofs = new OutputFileStream(absl::GetFlag(FLAGS_output).c_str(),
                                  std::ios::out | std::ios::binary);
     } else {
-      ofs = new OutputFileStream(mozc::GetFlag(FLAGS_output).c_str());
+      ofs = new OutputFileStream(absl::GetFlag(FLAGS_output).c_str());
     }
   }
 
-  if (mozc::GetFlag(FLAGS_binary_mode)) {
-    OutputExistenceBinary(entries, ofs, mozc::GetFlag(FLAGS_error_rate));
+  if (absl::GetFlag(FLAGS_binary_mode)) {
+    OutputExistenceBinary(entries, ofs, absl::GetFlag(FLAGS_error_rate));
   } else {
     const std::string kNameSpace = "CollocationSuppressionData";
     OutputExistenceHeader(entries, kNameSpace, ofs,
-                          mozc::GetFlag(FLAGS_error_rate));
+                          absl::GetFlag(FLAGS_error_rate));
   }
 
   if (ofs != &std::cout) {
@@ -108,7 +108,7 @@ void Convert() {
 int main(int argc, char *argv[]) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  LOG(INFO) << mozc::GetFlag(FLAGS_suppression_data);
+  LOG(INFO) << absl::GetFlag(FLAGS_suppression_data);
 
   mozc::Convert();
 
diff --git rewriter/gen_emoticon_rewriter_data.cc rewriter/gen_emoticon_rewriter_data.cc
index ce866d574..a79f5e12f 100644
--- rewriter/gen_emoticon_rewriter_data.cc
+++ rewriter/gen_emoticon_rewriter_data.cc
@@ -33,17 +33,17 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/mozc_hash_map.h"
 #include "base/util.h"
 #include "data_manager/serialized_dictionary.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(string, input, "", "Emoticon dictionary file");
-MOZC_FLAG(string, output_token_array, "", "Output token array");
-MOZC_FLAG(string, output_string_array, "", "Output string array");
+ABSL_FLAG(std::string, input, "", "Emoticon dictionary file");
+ABSL_FLAG(std::string, output_token_array, "", "Output token array");
+ABSL_FLAG(std::string, output_string_array, "", "Output string array");
 
 namespace mozc {
 namespace {
@@ -129,9 +129,9 @@ std::map<std::string, TokenList> ReadEmoticonTsv(const std::string &path) {
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  const auto &input_data = mozc::ReadEmoticonTsv(mozc::GetFlag(FLAGS_input));
+  const auto &input_data = mozc::ReadEmoticonTsv(absl::GetFlag(FLAGS_input));
   mozc::SerializedDictionary::CompileToFiles(
-      input_data, mozc::GetFlag(FLAGS_output_token_array),
-      mozc::GetFlag(FLAGS_output_string_array));
+      input_data, absl::GetFlag(FLAGS_output_token_array),
+      absl::GetFlag(FLAGS_output_string_array));
   return 0;
 }
diff --git rewriter/gen_single_kanji_noun_prefix_data.cc rewriter/gen_single_kanji_noun_prefix_data.cc
index 0ef651e0f..61df3ab9b 100644
--- rewriter/gen_single_kanji_noun_prefix_data.cc
+++ rewriter/gen_single_kanji_noun_prefix_data.cc
@@ -30,14 +30,14 @@
 #include <map>
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/port.h"
 #include "data_manager/serialized_dictionary.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, output_token_array, "",
+ABSL_FLAG(std::string, output_token_array, "",
           "Output token array of noun prefix dictionary");
-MOZC_FLAG(string, output_string_array, "",
+ABSL_FLAG(std::string, output_string_array, "",
           "Output string array of noun prefix dictionary");
 
 namespace {
@@ -99,7 +99,7 @@ int main(int argc, char **argv) {
     tokens[entry.key].emplace_back(std::move(token));
   }
   mozc::SerializedDictionary::CompileToFiles(
-      tokens, mozc::GetFlag(FLAGS_output_token_array),
-      mozc::GetFlag(FLAGS_output_string_array));
+      tokens, absl::GetFlag(FLAGS_output_token_array),
+      absl::GetFlag(FLAGS_output_string_array));
   return 0;
 }
diff --git rewriter/gen_symbol_rewriter_dictionary_main.cc rewriter/gen_symbol_rewriter_dictionary_main.cc
index bdafb0ecc..790d27387 100644
--- rewriter/gen_symbol_rewriter_dictionary_main.cc
+++ rewriter/gen_symbol_rewriter_dictionary_main.cc
@@ -45,20 +45,22 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
 #include "data_manager/data_manager.h"
 #include "data_manager/serialized_dictionary.h"
 #include "rewriter/dictionary_generator.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, sorting_table, "", "sorting table file");
-MOZC_FLAG(string, ordering_rule, "", "sorting order file");
-MOZC_FLAG(string, input, "", "symbol dictionary file");
-MOZC_FLAG(string, user_pos_manager_data, "", "user pos manager data file");
-MOZC_FLAG(string, output_token_array, "", "output token array binary file");
-MOZC_FLAG(string, output_string_array, "", "output string array binary file");
+ABSL_FLAG(std::string, sorting_table, "", "sorting table file");
+ABSL_FLAG(std::string, ordering_rule, "", "sorting order file");
+ABSL_FLAG(std::string, input, "", "symbol dictionary file");
+ABSL_FLAG(std::string, user_pos_manager_data, "", "user pos manager data file");
+ABSL_FLAG(std::string, output_token_array, "",
+          "output token array binary file");
+ABSL_FLAG(std::string, output_string_array, "",
+          "output string array binary file");
 
 namespace mozc {
 namespace {
@@ -202,34 +204,34 @@ void MakeDictionary(const std::string &symbol_dictionary_file,
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if ((mozc::GetFlag(FLAGS_input).empty() ||
-       mozc::GetFlag(FLAGS_sorting_table).empty() ||
-       mozc::GetFlag(FLAGS_ordering_rule).empty()) &&
+  if ((absl::GetFlag(FLAGS_input).empty() ||
+       absl::GetFlag(FLAGS_sorting_table).empty() ||
+       absl::GetFlag(FLAGS_ordering_rule).empty()) &&
       argc > 3) {
-    mozc::SetFlag(&FLAGS_input, argv[1]);
-    mozc::SetFlag(&FLAGS_sorting_table, argv[2]);
-    mozc::SetFlag(&FLAGS_ordering_rule, argv[3]);
+    absl::SetFlag(&FLAGS_input, argv[1]);
+    absl::SetFlag(&FLAGS_sorting_table, argv[2]);
+    absl::SetFlag(&FLAGS_ordering_rule, argv[3]);
   }
 
   const std::string tmp_text_file =
-      mozc::GetFlag(FLAGS_output_token_array) + ".txt";
+      absl::GetFlag(FLAGS_output_token_array) + ".txt";
 
   // User pos manager data for build tools has no magic number.
   const char *kMagciNumber = "";
   mozc::DataManager data_manager;
   const mozc::DataManager::Status status =
       data_manager.InitUserPosManagerDataFromFile(
-          mozc::GetFlag(FLAGS_user_pos_manager_data), kMagciNumber);
+          absl::GetFlag(FLAGS_user_pos_manager_data), kMagciNumber);
   CHECK_EQ(status, mozc::DataManager::Status::OK);
 
   mozc::rewriter::DictionaryGenerator dictionary(data_manager);
-  mozc::MakeDictionary(mozc::GetFlag(FLAGS_input),
-                       mozc::GetFlag(FLAGS_sorting_table),
-                       mozc::GetFlag(FLAGS_ordering_rule), &dictionary);
+  mozc::MakeDictionary(absl::GetFlag(FLAGS_input),
+                       absl::GetFlag(FLAGS_sorting_table),
+                       absl::GetFlag(FLAGS_ordering_rule), &dictionary);
   dictionary.Output(tmp_text_file);
   mozc::SerializedDictionary::CompileToFiles(
-      tmp_text_file, mozc::GetFlag(FLAGS_output_token_array),
-      mozc::GetFlag(FLAGS_output_string_array));
+      tmp_text_file, absl::GetFlag(FLAGS_output_token_array),
+      absl::GetFlag(FLAGS_output_string_array));
   mozc::FileUtil::Unlink(tmp_text_file);
 
   return 0;
diff --git rewriter/gen_usage_rewriter_dictionary_main.cc rewriter/gen_usage_rewriter_dictionary_main.cc
index aaf4c069e..d92504f00 100644
--- rewriter/gen_usage_rewriter_dictionary_main.cc
+++ rewriter/gen_usage_rewriter_dictionary_main.cc
@@ -100,23 +100,24 @@
 #include <vector>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/serialized_string_array.h"
 #include "base/util.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
-MOZC_FLAG(string, usage_data_file, "", "usage data file");
-MOZC_FLAG(string, cforms_file, "", "cforms file");
-MOZC_FLAG(string, output_base_conjugation_suffix, "",
+ABSL_FLAG(std::string, usage_data_file, "", "usage data file");
+ABSL_FLAG(std::string, cforms_file, "", "cforms file");
+ABSL_FLAG(std::string, output_base_conjugation_suffix, "",
           "output base conjugation suffix array");
-MOZC_FLAG(string, output_conjugation_suffix, "",
+ABSL_FLAG(std::string, output_conjugation_suffix, "",
           "output conjugation suffix array");
-MOZC_FLAG(string, output_conjugation_index, "",
+ABSL_FLAG(std::string, output_conjugation_index, "",
           "output conjugation index array");
-MOZC_FLAG(string, output_usage_item_array, "", "output array of usage items");
-MOZC_FLAG(string, output_string_array, "", "output string array");
+ABSL_FLAG(std::string, output_usage_item_array, "",
+          "output array of usage items");
+ABSL_FLAG(std::string, output_string_array, "", "output string array");
 
 namespace mozc {
 namespace {
@@ -257,13 +258,13 @@ void Convert() {
   // Load cforms_file
   std::map<std::string, std::vector<ConjugationType>> inflection_map;
   std::map<std::string, ConjugationType> baseform_map;
-  LoadConjugation(mozc::GetFlag(FLAGS_cforms_file), &inflection_map,
+  LoadConjugation(absl::GetFlag(FLAGS_cforms_file), &inflection_map,
                   &baseform_map);
 
   // Load usage_data_file
   std::vector<UsageItem> usage_entries;
   std::vector<std::string> conjugation_list;
-  LoadUsage(mozc::GetFlag(FLAGS_usage_data_file), &usage_entries,
+  LoadUsage(absl::GetFlag(FLAGS_usage_data_file), &usage_entries,
             &conjugation_list);
   RemoveBaseformConjugationSuffix(baseform_map, &usage_entries);
   std::sort(usage_entries.begin(), usage_entries.end(), UsageItemKeynameCmp);
@@ -299,7 +300,7 @@ void Convert() {
   // Output base conjugation suffix data.
   {
     OutputFileStream ostream(
-        mozc::GetFlag(FLAGS_output_base_conjugation_suffix).c_str(),
+        absl::GetFlag(FLAGS_output_base_conjugation_suffix).c_str(),
         std::ios_base::out | std::ios_base::binary);
     for (const auto &conj : conjugation_list) {
       const uint32 key_suffix_index =
@@ -315,7 +316,7 @@ void Convert() {
   std::vector<int> conjugation_index(conjugation_list.size() + 1);
   {
     OutputFileStream ostream(
-        mozc::GetFlag(FLAGS_output_conjugation_suffix).c_str(),
+        absl::GetFlag(FLAGS_output_conjugation_suffix).c_str(),
         std::ios_base::out | std::ios_base::binary);
     int out_count = 0;
     for (size_t i = 0; i < conjugation_list.size(); ++i) {
@@ -349,7 +350,7 @@ void Convert() {
   // Output conjugation suffix data index.
   {
     OutputFileStream ostream(
-        mozc::GetFlag(FLAGS_output_conjugation_index).c_str(),
+        absl::GetFlag(FLAGS_output_conjugation_index).c_str(),
         std::ios_base::out | std::ios_base::binary);
     ostream.write(reinterpret_cast<const char *>(conjugation_index.data()),
                   4 * conjugation_index.size());
@@ -358,7 +359,7 @@ void Convert() {
   // Output usage data.
   {
     OutputFileStream ostream(
-        mozc::GetFlag(FLAGS_output_usage_item_array).c_str(),
+        absl::GetFlag(FLAGS_output_usage_item_array).c_str(),
         std::ios_base::out | std::ios_base::binary);
     int32 usage_id = 0;
     for (const UsageItem &item : usage_entries) {
@@ -383,7 +384,7 @@ void Convert() {
       strs.emplace_back(kv.first);
     }
     SerializedStringArray::SerializeToFile(
-        strs, mozc::GetFlag(FLAGS_output_string_array));
+        strs, absl::GetFlag(FLAGS_output_string_array));
   }
 }
 
diff --git rewriter/katakana_promotion_rewriter.h rewriter/katakana_promotion_rewriter.h
index 5c7d4384b..197f2f5fc 100644
--- rewriter/katakana_promotion_rewriter.h
+++ rewriter/katakana_promotion_rewriter.h
@@ -30,9 +30,9 @@
 // Rewriter to promote katakana transliterated candidate for mobile devices.
 // For mobile, we do not provide the shortcut to input katakana transliterated
 // candidate.
-// If the katakana candiadte is not ranked high, users need to scroll candidate
+// If the katakana candidate is not ranked high, users need to scroll candidate
 // page and find katakana.
-// This rewriter promotes katakana candiate so that users can find katakana
+// This rewriter promotes katakana candidate so that users can find katakana
 // at first glance.
 
 #ifndef MOZC_REWRITER_KATAKANA_PROMOTION_REWRITER_H_
diff --git rewriter/merger_rewriter_test.cc rewriter/merger_rewriter_test.cc
index 828d71709..b47947f2a 100644
--- rewriter/merger_rewriter_test.cc
+++ rewriter/merger_rewriter_test.cc
@@ -31,7 +31,6 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "converter/segments.h"
@@ -39,6 +38,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
@@ -103,7 +103,7 @@ class TestRewriter : public RewriterInterface {
 class MergerRewriterTest : public testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git rewriter/normalization_rewriter.cc rewriter/normalization_rewriter.cc
index c95190063..f822bcffa 100644
--- rewriter/normalization_rewriter.cc
+++ rewriter/normalization_rewriter.cc
@@ -57,7 +57,7 @@ bool NormalizeCandidate(Segment::Candidate *candidate, CandidateType type) {
       TextNormalizer::NormalizeText(candidate->content_value, &content_value);
       break;
     default:
-      LOG(ERROR) << "unkown type";
+      LOG(ERROR) << "unknown type";
       return false;
   }
 
diff --git rewriter/normalization_rewriter_test.cc rewriter/normalization_rewriter_test.cc
index 4d1ee86de..e69397b86 100644
--- rewriter/normalization_rewriter_test.cc
+++ rewriter/normalization_rewriter_test.cc
@@ -31,12 +31,12 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "converter/segments.h"
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -58,7 +58,7 @@ class NormalizationRewriterTest : public ::testing::Test {
   ~NormalizationRewriterTest() override = default;
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git rewriter/number_rewriter.cc rewriter/number_rewriter.cc
index fd2e55856..24ab9acb5 100644
--- rewriter/number_rewriter.cc
+++ rewriter/number_rewriter.cc
@@ -449,7 +449,7 @@ bool NumberRewriter::Rewrite(const ConversionRequest &request,
 
   bool modified = false;
   // Radix conversion is done only for conversion mode.
-  // Showing radix candidates is annoying for an user.
+  // Showing radix candidates is annoying for a user.
   const bool exec_radix_conversion =
       (segments->conversion_segments_size() == 1 &&
        segments->request_type() == Segments::CONVERSION);
diff --git rewriter/number_rewriter_test.cc rewriter/number_rewriter_test.cc
index 7e95f7964..6801c2cff 100644
--- rewriter/number_rewriter_test.cc
+++ rewriter/number_rewriter_test.cc
@@ -96,7 +96,7 @@ bool HasDescription(const Segment &segment, const std::string &description) {
   return false;
 }
 
-// Find candiadte id
+// Find candidate id
 bool FindCandidateId(const Segment &segment, const std::string &value,
                      int *id) {
   for (size_t i = 0; i < segment.candidates_size(); ++i) {
@@ -835,7 +835,7 @@ TEST_F(NumberRewriterTest, SeparatedArabicsTest) {
 // - POS: GeneralNoun (not *Number*)
 // In this case, NumberRewriter should not clear
 // Segment::Candidate::USER_DICTIONARY bit in the base candidate.
-TEST_F(NumberRewriterTest, PreserveUserDictionaryAttibute) {
+TEST_F(NumberRewriterTest, PreserveUserDictionaryAttribute) {
   std::unique_ptr<NumberRewriter> number_rewriter(CreateNumberRewriter());
   {
     Segments segments;
diff --git rewriter/rewriter.cc rewriter/rewriter.cc
index 0b1c0b7e9..ed5f4dc9d 100644
--- rewriter/rewriter.cc
+++ rewriter/rewriter.cc
@@ -29,7 +29,6 @@
 
 #include "rewriter/rewriter.h"
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "converter/converter_interface.h"
 #include "data_manager/data_manager_interface.h"
@@ -63,11 +62,12 @@
 #include "rewriter/variants_rewriter.h"
 #include "rewriter/version_rewriter.h"
 #include "rewriter/zipcode_rewriter.h"
+#include "absl/flags/flag.h"
 #ifndef NO_USAGE_REWRITER
 #include "rewriter/usage_rewriter.h"
 #endif  // NO_USAGE_REWRITER
 
-MOZC_FLAG(bool, use_history_rewriter, true, "Use history rewriter or not.");
+ABSL_FLAG(bool, use_history_rewriter, true, "Use history rewriter or not.");
 
 namespace mozc {
 namespace {
@@ -104,7 +104,7 @@ RewriterImpl::RewriterImpl(const ConverterInterface *parent_converter,
   AddRewriter(new ZipcodeRewriter(&pos_matcher_));
   AddRewriter(new DiceRewriter);
 
-  if (mozc::GetFlag(FLAGS_use_history_rewriter)) {
+  if (absl::GetFlag(FLAGS_use_history_rewriter)) {
     AddRewriter(new UserBoundaryHistoryRewriter(parent_converter));
     AddRewriter(new UserSegmentHistoryRewriter(&pos_matcher_, pos_group));
   }
diff --git rewriter/rewriter_test.cc rewriter/rewriter_test.cc
index 2ec18ba6e..23609cf05 100644
--- rewriter/rewriter_test.cc
+++ rewriter/rewriter_test.cc
@@ -33,7 +33,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "converter/converter_mock.h"
@@ -44,6 +43,7 @@
 #include "rewriter/rewriter_interface.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -68,7 +68,7 @@ size_t CommandCandidatesSize(const Segment &segment) {
 class RewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     converter_mock_ = absl::make_unique<ConverterMock>();
     const testing::MockDataManager data_manager;
     pos_group_ = absl::make_unique<PosGroup>(data_manager.GetPosGroupData());
diff --git rewriter/single_kanji_rewriter_test.cc rewriter/single_kanji_rewriter_test.cc
index 53d3a20ef..c47670f78 100644
--- rewriter/single_kanji_rewriter_test.cc
+++ rewriter/single_kanji_rewriter_test.cc
@@ -33,7 +33,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "config/config_handler.h"
@@ -44,6 +43,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -60,7 +60,7 @@ class SingleKanjiRewriterTest : public ::testing::Test {
   ~SingleKanjiRewriterTest() override = default;
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   SingleKanjiRewriter *CreateSingleKanjiRewriter() const {
diff --git rewriter/symbol_rewriter.cc rewriter/symbol_rewriter.cc
index ab2a417d8..74cfc02ba 100644
--- rewriter/symbol_rewriter.cc
+++ rewriter/symbol_rewriter.cc
@@ -170,7 +170,7 @@ void SymbolRewriter::InsertCandidates(
     size_t default_offset, const SerializedDictionary::IterRange &range,
     bool context_sensitive, Segment *segment) {
   if (segment->candidates_size() == 0) {
-    LOG(WARNING) << "candiadtes_size is 0";
+    LOG(WARNING) << "candidates_size is 0";
     return;
   }
 
@@ -181,7 +181,7 @@ void SymbolRewriter::InsertCandidates(
   // register space to CharacterFormManager.
   ExpandSpace(segment);
 
-  // If the original candidates given by ImmutableConveter already
+  // If the original candidates given by ImmutableConverter already
   // include the target symbols, do assign description to these candidates.
   AddDescForCurrentCandidates(range, segment);
 
diff --git rewriter/symbol_rewriter_test.cc rewriter/symbol_rewriter_test.cc
index 29f5d9fca..6460c1e8b 100644
--- rewriter/symbol_rewriter_test.cc
+++ rewriter/symbol_rewriter_test.cc
@@ -32,7 +32,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/util.h"
@@ -46,6 +45,7 @@
 #include "session/request_test_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -102,7 +102,7 @@ class SymbolRewriterTest : public ::testing::Test {
   ~SymbolRewriterTest() override = default;
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
     // We cannot use mock converter here because SymbolRewriter uses
     // ResizeSegment of converter implementation. However, SymbolRewriter is
diff --git rewriter/unicode_rewriter_test.cc rewriter/unicode_rewriter_test.cc
index e4af2c32f..aaffba108 100644
--- rewriter/unicode_rewriter_test.cc
+++ rewriter/unicode_rewriter_test.cc
@@ -34,7 +34,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "base/util.h"
@@ -48,6 +47,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -87,7 +87,7 @@ class UnicodeRewriterTest : public ::testing::Test {
   ~UnicodeRewriterTest() override {}
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     engine_.reset(MockDataEngineFactory::Create());
   }
 
diff --git rewriter/usage_rewriter.cc rewriter/usage_rewriter.cc
index 53aec1d9e..f07a18922 100644
--- rewriter/usage_rewriter.cc
+++ rewriter/usage_rewriter.cc
@@ -139,7 +139,7 @@ std::string UsageRewriter::GetKanjiPrefixAndOneHiragana(
 UsageRewriter::UsageDictItemIterator
 UsageRewriter::LookupUnmatchedUsageHeuristically(
     const Segment::Candidate &candidate) const {
-  // We check Unknwon POS ("名詞,サ変接続") as well, since
+  // We check Unknown POS ("名詞,サ変接続") as well, since
   // target verbs/adjectives may be in web dictionary.
   if (!pos_matcher_.IsContentWordWithConjugation(candidate.lid) &&
       !pos_matcher_.IsUnknown(candidate.lid)) {
diff --git rewriter/usage_rewriter_test.cc rewriter/usage_rewriter_test.cc
index 197e3f944..f45ddf27a 100644
--- rewriter/usage_rewriter_test.cc
+++ rewriter/usage_rewriter_test.cc
@@ -34,7 +34,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "converter/segments.h"
@@ -49,6 +48,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -79,7 +79,7 @@ class UsageRewriterTest : public ::testing::Test {
   }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     config::ConfigHandler::GetDefaultConfig(&config_);
 
     data_manager_ = absl::make_unique<testing::MockDataManager>();
diff --git rewriter/user_boundary_history_rewriter_test.cc rewriter/user_boundary_history_rewriter_test.cc
index 5e90260d8..b226c0f8a 100644
--- rewriter/user_boundary_history_rewriter_test.cc
+++ rewriter/user_boundary_history_rewriter_test.cc
@@ -34,7 +34,6 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "config/config_handler.h"
 #include "converter/converter_mock.h"
@@ -43,6 +42,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -83,7 +83,7 @@ class UserBoundaryHistoryRewriterTest : public ::testing::Test {
   UserBoundaryHistoryRewriterTest() { request_.set_config(&config_); }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     config::ConfigHandler::GetDefaultConfig(&config_);
   }
 
@@ -114,7 +114,7 @@ class UserBoundaryHistoryRewriterTest : public ::testing::Test {
 TEST_F(UserBoundaryHistoryRewriterTest, CreateFile) {
   UserBoundaryHistoryRewriter rewriter(&mock());
   const std::string history_file =
-      mozc::GetFlag(FLAGS_test_tmpdir) + "/boundary.db";
+      absl::GetFlag(FLAGS_test_tmpdir) + "/boundary.db";
   EXPECT_TRUE(FileUtil::FileExists(history_file));
 }
 
@@ -227,8 +227,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenIncognito) {
   SetIncognito(false);  // no_incognito when rewrite
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenReadOnly) {
@@ -250,8 +250,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenReadOnly) {
 
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenDisableUserHistory) {
@@ -273,8 +273,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenDisableUserHistory) {
 
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenNotResized) {
@@ -296,8 +296,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoInsertWhenNotResized) {
 
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteAfterClear) {
@@ -322,8 +322,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteAfterClear) {
   const std::string segments_str = segments.DebugString();
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenIncognito) {
@@ -346,8 +346,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenIncognito) {
   SetIncognito(true);
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenNoHistory) {
@@ -370,8 +370,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenNoHistory) {
   SetLearningLevel(config::Config::NO_HISTORY);
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenDisabledUserHistory) {
@@ -393,8 +393,8 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenDisabledUserHistory) {
   const std::string segments_str = segments.DebugString();
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 
 TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenAlreadyResized) {
@@ -417,7 +417,7 @@ TEST_F(UserBoundaryHistoryRewriterTest, NoRewriteWhenAlreadyResized) {
   const std::string segments_str = segments.DebugString();
   EXPECT_FALSE(rewriter.Rewrite(request_, &segments));
 
-  const std::string segments_rewrited_str = segments.DebugString();
-  EXPECT_EQ(segments_str, segments_rewrited_str);
+  const std::string segments_rewritten_str = segments.DebugString();
+  EXPECT_EQ(segments_str, segments_rewritten_str);
 }
 }  // namespace mozc
diff --git rewriter/user_dictionary_rewriter_test.cc rewriter/user_dictionary_rewriter_test.cc
index f54ddc22b..7cccdb11d 100644
--- rewriter/user_dictionary_rewriter_test.cc
+++ rewriter/user_dictionary_rewriter_test.cc
@@ -33,7 +33,6 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/util.h"
@@ -41,6 +40,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 
@@ -85,7 +85,7 @@ class UserDictionaryRewriterTest : public testing::Test {
   ~UserDictionaryRewriterTest() override {}
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   void TearDown() override {}
diff --git rewriter/user_segment_history_rewriter.cc rewriter/user_segment_history_rewriter.cc
index 5d1f0bd24..d4e3448b2 100644
--- rewriter/user_segment_history_rewriter.cc
+++ rewriter/user_segment_history_rewriter.cc
@@ -142,10 +142,10 @@ class ScoreTypeCompare {
   }
 };
 
-// return the first candiadte which has "BEST_CANDIDATE" attribute
+// return the first candidate which has "BEST_CANDIDATE" attribute
 inline int GetDefaultCandidateIndex(const Segment &segment) {
   // Check up to kMaxRerankSize + 1 candidates because candidate with
-  // BEST_CANDIATE is highly possibly in that range (http://b/9992330).
+  // BEST_CANDIDATE is highly possibly in that range (http://b/9992330).
   const int size =
       static_cast<int>(std::min(segment.candidates_size(), kMaxRerankSize + 1));
   for (int i = 0; i < size; ++i) {
@@ -690,7 +690,7 @@ void UserSegmentHistoryRewriter::RememberFirstCandidate(
   const std::string &all_key = seg.key();
   const std::string &content_key = candidate.content_key;
 
-  // even if the candiate was the top (default) candidate,
+  // even if the candidate was the top (default) candidate,
   // ERANKED will be set when user changes the ranking
   const bool force_insert =
       ((candidate.attributes & Segment::Candidate::RERANKED) != 0);
diff --git rewriter/user_segment_history_rewriter_test.cc rewriter/user_segment_history_rewriter_test.cc
index c3271a7d8..d34069bbe 100644
--- rewriter/user_segment_history_rewriter_test.cc
+++ rewriter/user_segment_history_rewriter_test.cc
@@ -35,7 +35,6 @@
 #include "base/clock.h"
 #include "base/clock_mock.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/number_util.h"
 #include "base/system_util.h"
@@ -52,6 +51,7 @@
 #include "rewriter/variants_rewriter.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -113,7 +113,7 @@ class UserSegmentHistoryRewriterTest : public ::testing::Test {
   UserSegmentHistoryRewriterTest() { request_.set_config(&config_); }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
     ConfigHandler::GetDefaultConfig(&config_);
     for (int i = 0; i < config_.character_form_rules_size(); ++i) {
@@ -181,7 +181,7 @@ TEST_F(UserSegmentHistoryRewriterTest, CreateFile) {
   std::unique_ptr<UserSegmentHistoryRewriter> rewriter(
       CreateUserSegmentHistoryRewriter());
   const std::string history_file =
-      FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir), "/segment.db");
+      FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir), "/segment.db");
   EXPECT_TRUE(FileUtil::FileExists(history_file));
 }
 
diff --git rewriter/variants_rewriter.cc rewriter/variants_rewriter.cc
index 51cf50a09..9082b9461 100644
--- rewriter/variants_rewriter.cc
+++ rewriter/variants_rewriter.cc
@@ -313,7 +313,7 @@ bool VariantsRewriter::RewriteSegment(RewriteType type, Segment *seg) const {
     if (original_candidate->attributes &
         Segment::Candidate::NO_VARIANTS_EXPANSION) {
       SetDescriptionForCandidate(pos_matcher_, original_candidate);
-      VLOG(1) << "Canidate has NO_NORMALIZATION node";
+      VLOG(1) << "Candidate has NO_NORMALIZATION node";
       continue;
     }
 
diff --git rewriter/variants_rewriter_test.cc rewriter/variants_rewriter_test.cc
index 7b92e09ec..78bef9ed5 100644
--- rewriter/variants_rewriter_test.cc
+++ rewriter/variants_rewriter_test.cc
@@ -426,7 +426,7 @@ TEST_F(VariantsRewriterTest, SetDescriptionForCandidate) {
     candidate.content_key = "ねずみ";
     candidate.description = "絵文字";
     VariantsRewriter::SetDescriptionForCandidate(pos_matcher_, &candidate);
-    // "絵文字 <機種依存文字>" for Desktop, "絵文字 <機種依存>" for Andorid
+    // "絵文字 <機種依存文字>" for Desktop, "絵文字 <機種依存>" for Android
     std::string expected(
         "絵文字"
         " ");
diff --git rewriter/version_rewriter_test.cc rewriter/version_rewriter_test.cc
index 53ea65640..c7b91c5d1 100644
--- rewriter/version_rewriter_test.cc
+++ rewriter/version_rewriter_test.cc
@@ -32,7 +32,6 @@
 #include <cstddef>
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "config/config_handler.h"
@@ -41,6 +40,7 @@
 #include "request/conversion_request.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -52,7 +52,7 @@ const char *kDummyDataVersion = "dataversion";
 class VersionRewriterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   static void AddSegment(const std::string &key, const std::string &value,
diff --git server/BUILD server/BUILD
index c65968856..af14825f9 100644
--- server/BUILD
+++ server/BUILD
@@ -64,7 +64,6 @@ cc_library_mozc(
     deps = [
         "//base",
         "//base:crash_report_handler",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
@@ -85,7 +84,6 @@ cc_binary_mozc(
     srcs = ["mozc_rpc_server_main.cc"],
     deps = [
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base:singleton",
         "//base:system_util",
diff --git server/cache_service_manager.cc server/cache_service_manager.cc
index 5fcd064f3..48cbf045a 100644
--- server/cache_service_manager.cc
+++ server/cache_service_manager.cc
@@ -148,14 +148,14 @@ bool DeserializeFromBase64WString(const std::wstring &src,
 //  - It turns out w/o any error that the cache service is not installed.
 //    In this case, |handle| owns a NULL handle.
 // Otherwise, returns false.
-bool GetCacheService(DWORD service_controler_rights, DWORD service_rights,
+bool GetCacheService(DWORD service_controller_rights, DWORD service_rights,
                      ScopedSCHandle *handle) {
   if (NULL == handle) {
     return false;
   }
 
   ScopedSCHandle sc_handle(
-      ::OpenSCManager(NULL, NULL, service_controler_rights));
+      ::OpenSCManager(NULL, NULL, service_controller_rights));
   if (NULL == sc_handle.get()) {
     LOG(ERROR) << "OpenSCManager failed: " << ::GetLastError();
     return false;
@@ -314,7 +314,7 @@ bool RestoreStateInternal(const cache_service::Win32ServiceState &state) {
 
   const bool now_running = IsServiceRunning(service_handle);
 
-  // If the service was runnning and is not running now, start it unless the
+  // If the service was running and is not running now, start it unless the
   // load type is not DISABLED.
   if (state.running() && !now_running &&
       (state.load_type() != cache_service::Win32ServiceState::DISABLED)) {
@@ -326,7 +326,7 @@ bool RestoreStateInternal(const cache_service::Win32ServiceState &state) {
       }
     }
     return StartServiceInternal(service_handle, arguments);
-    // If the service is now runnning and was not running, stop it.
+    // If the service is now running and was not running, stop it.
   } else if (!state.running() && now_running) {
     return StopService(service_handle);
     // Nothing to do.
@@ -407,7 +407,7 @@ bool CacheServiceManager::IsEnabled() {
   }
 
   // This byte array will contain both QUERY_SERVICE_CONFIG and some
-  // string buffers which are reffered by corresponding members of
+  // string buffers which are referred by corresponding members of
   // QUERY_SERVICE_CONFIG.  We have to keep the array until we complete
   // all tasks which use the contents of QUERY_SERVICE_CONFIG.
   std::unique_ptr<char[]> buffer;
@@ -539,7 +539,7 @@ bool CacheServiceManager::BackupStateAsString(std::wstring *result) {
     state.set_running(true);
   } else {
     // This byte array will contain both QUERY_SERVICE_CONFIG and some
-    // string buffers which are reffered by corresponding members of
+    // string buffers which are referred by corresponding members of
     // QUERY_SERVICE_CONFIG.  We have to keep the array until we complete
     // all tasks which use the contents of QUERY_SERVICE_CONFIG.
     std::unique_ptr<char[]> buffer;
diff --git server/mozc_cache_service.rc server/mozc_cache_service.rc
index aa89ce828..9bb7c8d95 100644
Binary files server/mozc_cache_service.rc and server/mozc_cache_service.rc differ
diff --git server/mozc_rpc_server_main.cc server/mozc_rpc_server_main.cc
index 296e0373f..6160b6cd2 100644
--- server/mozc_rpc_server_main.cc
+++ server/mozc_rpc_server_main.cc
@@ -27,7 +27,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include "absl/flags/flag.h"
 #ifdef OS_WIN
 #include <windows.h>
 #include <ws2tcpip.h>
@@ -47,7 +46,6 @@ using ssize_t = SSIZE_T;
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/singleton.h"
 #include "base/system_util.h"
@@ -56,14 +54,15 @@ using ssize_t = SSIZE_T;
 #include "session/random_keyevents_generator.h"
 #include "session/session_handler.h"
 #include "session/session_usage_observer.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, host, "localhost", "server host name");
-MOZC_FLAG(bool, server, true, "server mode");
-MOZC_FLAG(bool, client, false, "client mode");
-MOZC_FLAG(int32, client_test_size, 100, "client test size");
-MOZC_FLAG(int32, port, 8000, "port of RPC server");
-MOZC_FLAG(int32, rpc_timeout, 60000, "timeout");
-MOZC_FLAG(string, user_profile_directory, "", "user profile directory");
+ABSL_FLAG(std::string, host, "localhost", "server host name");
+ABSL_FLAG(bool, server, true, "server mode");
+ABSL_FLAG(bool, client, false, "client mode");
+ABSL_FLAG(int32, client_test_size, 100, "client test size");
+ABSL_FLAG(int32, port, 8000, "port of RPC server");
+ABSL_FLAG(int32, rpc_timeout, 60000, "timeout");
+ABSL_FLAG(std::string, user_profile_directory, "", "user profile directory");
 
 namespace mozc {
 
@@ -144,7 +143,7 @@ class RPCServer {
 #endif
 
     ::memset(&sin, 0, sizeof(sin));
-    sin.sin_port = htons(mozc::GetFlag(FLAGS_port));
+    sin.sin_port = htons(absl::GetFlag(FLAGS_port));
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = htonl(INADDR_ANY);
 
@@ -182,7 +181,7 @@ class RPCServer {
       uint32 request_size = 0;
       // Receive the size of data.
       if (!Recv(client_socket, reinterpret_cast<char *>(&request_size),
-                sizeof(request_size), mozc::GetFlag(FLAGS_rpc_timeout))) {
+                sizeof(request_size), absl::GetFlag(FLAGS_rpc_timeout))) {
         LOG(ERROR) << "Cannot receive request_size header.";
         CloseSocket(client_socket);
         continue;
@@ -194,7 +193,7 @@ class RPCServer {
       // Receive the body of serialized protobuf.
       std::unique_ptr<char[]> request_str(new char[request_size]);
       if (!Recv(client_socket, request_str.get(), request_size,
-                mozc::GetFlag(FLAGS_rpc_timeout))) {
+                absl::GetFlag(FLAGS_rpc_timeout))) {
         LOG(ERROR) << "cannot receive body of request.";
         CloseSocket(client_socket);
         continue;
@@ -220,9 +219,9 @@ class RPCServer {
       output_size = htonl(output_size);
 
       if (!Send(client_socket, reinterpret_cast<char *>(&output_size),
-                sizeof(output_size), mozc::GetFlag(FLAGS_rpc_timeout)) ||
+                sizeof(output_size), absl::GetFlag(FLAGS_rpc_timeout)) ||
           !Send(client_socket, output_str.data(), output_str.size(),
-                mozc::GetFlag(FLAGS_rpc_timeout))) {
+                absl::GetFlag(FLAGS_rpc_timeout))) {
         LOG(ERROR) << "Cannot send reply.";
       }
 
@@ -284,8 +283,8 @@ class RPCClient {
     hints.ai_socktype = SOCK_STREAM;
     hints.ai_family = AF_INET;
 
-    const std::string port_str = std::to_string(mozc::GetFlag(FLAGS_port));
-    CHECK_EQ(::getaddrinfo(mozc::GetFlag(FLAGS_host).c_str(), port_str.c_str(),
+    const std::string port_str = std::to_string(absl::GetFlag(FLAGS_port));
+    CHECK_EQ(::getaddrinfo(absl::GetFlag(FLAGS_host).c_str(), port_str.c_str(),
                            &hints, &res),
              0)
         << "getaddrinfo failed";
@@ -304,20 +303,20 @@ class RPCClient {
     request_size = htonl(request_size);
 
     CHECK(Send(client_socket, reinterpret_cast<char *>(&request_size),
-               sizeof(request_size), mozc::GetFlag(FLAGS_rpc_timeout)));
+               sizeof(request_size), absl::GetFlag(FLAGS_rpc_timeout)));
     CHECK(Send(client_socket, request_str.data(), request_str.size(),
-               mozc::GetFlag(FLAGS_rpc_timeout)));
+               absl::GetFlag(FLAGS_rpc_timeout)));
 
     uint32 output_size = 0;
     CHECK(Recv(client_socket, reinterpret_cast<char *>(&output_size),
-               sizeof(output_size), mozc::GetFlag(FLAGS_rpc_timeout)));
+               sizeof(output_size), absl::GetFlag(FLAGS_rpc_timeout)));
     output_size = ntohl(output_size);
     CHECK_GT(output_size, 0);
     CHECK_LT(output_size, kMaxOutputSize);
 
     std::unique_ptr<char[]> output_str(new char[output_size]);
     CHECK(Recv(client_socket, output_str.get(), output_size,
-               mozc::GetFlag(FLAGS_rpc_timeout)));
+               absl::GetFlag(FLAGS_rpc_timeout)));
 
     CHECK(output->ParseFromArray(output_str.get(), output_size));
 
@@ -355,17 +354,17 @@ int main(int argc, char *argv[]) {
 
   mozc::ScopedWSAData wsadata;
 
-  if (!mozc::GetFlag(FLAGS_user_profile_directory).empty()) {
+  if (!absl::GetFlag(FLAGS_user_profile_directory).empty()) {
     LOG(INFO) << "Setting user profile directory to "
-              << mozc::GetFlag(FLAGS_user_profile_directory);
+              << absl::GetFlag(FLAGS_user_profile_directory);
     mozc::SystemUtil::SetUserProfileDirectory(
-        mozc::GetFlag(FLAGS_user_profile_directory));
+        absl::GetFlag(FLAGS_user_profile_directory));
   }
 
-  if (mozc::GetFlag(FLAGS_client)) {
+  if (absl::GetFlag(FLAGS_client)) {
     mozc::RPCClient client;
     CHECK(client.CreateSession());
-    for (int n = 0; n < mozc::GetFlag(FLAGS_client_test_size); ++n) {
+    for (int n = 0; n < absl::GetFlag(FLAGS_client_test_size); ++n) {
       std::vector<mozc::commands::KeyEvent> keys;
       mozc::session::RandomKeyEventsGenerator::GenerateSequence(&keys);
       for (size_t i = 0; i < keys.size(); ++i) {
@@ -377,7 +376,7 @@ int main(int argc, char *argv[]) {
     }
     CHECK(client.DeleteSession());
     return 0;
-  } else if (mozc::GetFlag(FLAGS_server)) {
+  } else if (absl::GetFlag(FLAGS_server)) {
     mozc::RPCServer server;
     server.Loop();
   } else {
diff --git server/mozc_server.cc server/mozc_server.cc
index 228344f9d..bd3ecd39c 100644
--- server/mozc_server.cc
+++ server/mozc_server.cc
@@ -29,8 +29,6 @@
 
 #include "server/mozc_server.h"
 
-#include "absl/flags/flag.h"
-
 #ifdef OS_WIN
 #include <windows.h>
 #endif
@@ -40,7 +38,6 @@
 #include <string>
 
 #include "base/crash_report_handler.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/process_mutex.h"
@@ -50,8 +47,10 @@
 #include "base/util.h"
 #include "config/stats_config_util.h"
 #include "session/session_server.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
-MOZC_DECLARE_FLAG(bool, restricted);  // in SessionHandler
+ABSL_DECLARE_FLAG(bool, restricted);  // in SessionHandler
 
 namespace {
 mozc::SessionServer *g_session_server = NULL;
@@ -92,7 +91,7 @@ void InitMozcAndMozcServer(const char *arg0, int *argc, char ***argv,
 
   if (run_level == mozc::RunLevel::RESTRICTED) {
     VLOG(1) << "Mozc server starts with timeout mode";
-    mozc::SetFlag(&FLAGS_restricted, true);
+    absl::SetFlag(&FLAGS_restricted, true);
   }
 }
 
diff --git server/mozc_server.rc server/mozc_server.rc
index fd97c8767..d78370110 100644
Binary files server/mozc_server.rc and server/mozc_server.rc differ
diff --git session/BUILD session/BUILD
index cc47ec3cf..07c7cf81e 100644
--- session/BUILD
+++ session/BUILD
@@ -73,7 +73,6 @@ cc_library_mozc(
         ":session_converter_interface",
         ":session_usage_stats_util",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:text_normalizer",
@@ -90,6 +89,7 @@ cc_library_mozc(
         "//session/internal:session_output",
         "//transliteration",
         "//usage_stats",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -103,7 +103,6 @@ cc_test_mozc(
         ":request_test_util",
         ":session_converter",
         "//base",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//base:util",
@@ -123,6 +122,7 @@ cc_test_mozc(
         "//transliteration",
         "//usage_stats",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -136,7 +136,6 @@ cc_test_mozc(
         ":session_converter",
         "//base",
         "//base:clock",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//base:util",
@@ -148,6 +147,7 @@ cc_test_mozc(
         "//protocol:commands_proto",
         "//protocol:config_proto",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -251,7 +251,6 @@ cc_test_mozc(
         ":session_handler",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
@@ -269,6 +268,7 @@ cc_test_mozc(
         "//session/internal:ime_context",
         "//session/internal:keymap",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -341,7 +341,7 @@ cc_library_mozc(
         "//usage_stats",
         "@com_google_absl//absl/memory",
     ] + [
-        "//base:flags",
+        "@com_google_absl//absl/flags:flag",
         "//base:logging",
         "//base:port",
         "//base:singleton",
@@ -371,7 +371,6 @@ cc_library_mozc(
         "//base",
         "//base:config_file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
@@ -389,6 +388,7 @@ cc_library_mozc(
         "//testing",
         "//testing:gunit_prod",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -405,7 +405,6 @@ cc_test_mozc(
         ":session_handler_test_util",
         "//base",
         "//base:clock_mock",
-        "//base:flags",
         "//base:port",
         "//base:stopwatch",
         "//base:util",
@@ -421,6 +420,7 @@ cc_test_mozc(
         "//testing:gunit_main",
         "//usage_stats",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -456,10 +456,10 @@ cc_test_mozc(
     deps = [
         ":session_server",
         "//base",
-        "//base:flags",
         "//base:scheduler",
         "//base:system_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -503,7 +503,6 @@ cc_binary_mozc(
         "//base",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:port",
@@ -514,6 +513,7 @@ cc_binary_mozc(
         "//engine:engine_interface",
         "//protocol:commands_proto",
         "//protocol:config_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -524,9 +524,9 @@ cc_binary_mozc(
     copts = ["$(STACK_FRAME_UNLIMITED)"],  # session_server_main.cc
     deps = [
         ":session_server",
-        "//base:flags",
         "//base:init_mozc",
         "//protocol:commands_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings:str_format",
     ],
 )
@@ -599,7 +599,6 @@ cc_test_mozc(
         ":session_usage_observer",
         "//base",
         "//base:clock_mock",
-        "//base:flags",
         "//base:logging",
         "//base:scheduler",
         "//base:scheduler_stub",
@@ -612,6 +611,7 @@ cc_test_mozc(
         "//usage_stats",
         "//usage_stats:usage_stats_proto",
         "//usage_stats:usage_stats_testing_util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
@@ -782,7 +782,6 @@ cc_binary_mozc(
     deps = [
         ":session_handler_tool",
         "//base:file_stream",
-        "//base:flags",
         "//base:init_mozc",
         "//base:status",
         "//base:system_util",
@@ -791,6 +790,7 @@ cc_binary_mozc(
         "//data_manager/oss:oss_data_manager",
         "//engine",
         "//protocol:commands_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git session/ime_switch_util.h session/ime_switch_util.h
index c7246e84e..12e27ab66 100644
--- session/ime_switch_util.h
+++ session/ime_switch_util.h
@@ -51,7 +51,7 @@ class ImeSwitchUtil {
   // Returns true if 'key' is assigned for any command in direct mode.
   // We want to know this configuration before starting mozc server,
   // because we use this config to start mozc server.
-  // Please call this fuction only when the server is not runnning.
+  // Please call this fuction only when the server is not running.
   static bool IsDirectModeCommand(const commands::KeyEvent &key);
 
   static void ReloadConfig(const Config &config);
diff --git session/internal/BUILD session/internal/BUILD
index f33e8bb6e..4dfb9019d 100644
--- session/internal/BUILD
+++ session/internal/BUILD
@@ -187,13 +187,13 @@ cc_test_mozc(
         ":keymap",
         ":keymap_factory",
         "//base:config_file_stream",
-        "//base:flags",
         "//base:system_util",
         "//composer:key_parser",
         "//config:config_handler",
         "//protocol:commands_proto",
         "//protocol:config_proto",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git session/internal/key_event_transformer.cc session/internal/key_event_transformer.cc
index 79ab34c5e..9ed550dd5 100644
--- session/internal/key_event_transformer.cc
+++ session/internal/key_event_transformer.cc
@@ -157,7 +157,7 @@ bool KeyEventTransformer::TransformKeyEventForNumpad(
   }
 
   // All key event except for KeyEvent::SEPARATOR should have key code
-  // and it's value should represent a ASCII character since it is generated
+  // and its value should represent a ASCII character since it is generated
   // from numpad key.
   DCHECK(key_event->has_key_code());
   const uint32 key_code = key_event->key_code();
diff --git session/internal/keymap_interface.h session/internal/keymap_interface.h
index 91840a4d6..e2a585c18 100644
--- session/internal/keymap_interface.h
+++ session/internal/keymap_interface.h
@@ -102,7 +102,7 @@ struct CompositionState {
     INSERT_ALTERNATE_SPACE,
     INSERT_HALF_SPACE,   // Input half-width space
     INSERT_FULL_SPACE,   // Input full-width space
-    CANCEL,              // Move to Precomposition stauts.
+    CANCEL,              // Move to Precomposition status.
     CANCEL_AND_IME_OFF,  // Cancel composition and turn off IME
     UNDO,
     MOVE_CURSOR_LEFT,
diff --git session/internal/keymap_test.cc session/internal/keymap_test.cc
index 76ed26f1b..90f07e17c 100644
--- session/internal/keymap_test.cc
+++ session/internal/keymap_test.cc
@@ -36,7 +36,6 @@
 #include <vector>
 
 #include "base/config_file_stream.h"
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "composer/key_parser.h"
 #include "config/config_handler.h"
@@ -46,6 +45,7 @@
 #include "session/internal/keymap_factory.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace keymap {
@@ -53,7 +53,7 @@ namespace keymap {
 class KeyMapTest : public testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 
   bool isInputModeXCommandSupported() const {
diff --git session/session.cc session/session.cc
index 878f1ec9d..d7d9cc61b 100644
--- session/session.cc
+++ session/session.cc
@@ -1443,7 +1443,7 @@ bool Session::InsertCharacter(commands::Command *command) {
   bool should_commit = (context_->state() == ImeContext::CONVERSION);
 
   if (context_->GetRequest().space_on_alphanumeric() ==
-          commands::Request::SPACE_OR_CONVERT_COMMITING_COMPOSITION &&
+          commands::Request::SPACE_OR_CONVERT_COMMITTING_COMPOSITION &&
       context_->state() == ImeContext::COMPOSITION &&
       // TODO(komatsu): Support FullWidthSpace
       Util::EndsWith(composition, " ")) {
@@ -2289,7 +2289,7 @@ bool Session::Convert(commands::Command *command) {
         return Commit(command);
       } else {
         // SPACE_OR_CONVERT_KEEPING_COMPOSITION or
-        // SPACE_OR_CONVERT_COMMITING_COMPOSITION.
+        // SPACE_OR_CONVERT_COMMITTING_COMPOSITION.
 
         // If the last character is not space, space is inserted to the
         // composition.
diff --git session/session.h session/session.h
index 6d3e09dd8..08748d2c2 100644
--- session/session.h
+++ session/session.h
@@ -266,7 +266,7 @@ class Session : public SessionInterface {
   // return 0 (default value) if no command is executed in this session.
   uint64 last_command_time() const override;
 
-  // TODO(komatsu): delete this funciton.
+  // TODO(komatsu): delete this function.
   // For unittest only
   mozc::composer::Composer *get_internal_composer_only_for_unittest();
 
diff --git session/session_client_main.cc session/session_client_main.cc
index 6b787cbe0..548d336d2 100644
--- session/session_client_main.cc
+++ session/session_client_main.cc
@@ -33,7 +33,6 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
@@ -44,11 +43,12 @@
 #include "engine/engine_interface.h"
 #include "protocol/commands.pb.h"
 #include "session/session.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
-MOZC_FLAG(string, input, "", "Input file");
-MOZC_FLAG(string, output, "", "Output file");
-MOZC_FLAG(string, profile_dir, "", "Profile dir");
+ABSL_FLAG(std::string, input, "", "Input file");
+ABSL_FLAG(std::string, output, "", "Output file");
+ABSL_FLAG(std::string, profile_dir, "", "Profile dir");
 
 namespace mozc {
 
@@ -94,9 +94,9 @@ int main(int argc, char **argv) {
   std::istream *input = nullptr;
   std::ostream *output = nullptr;
 
-  const std::string flags_profile_dir = mozc::GetFlag(FLAGS_profile_dir);
-  const std::string flags_input = mozc::GetFlag(FLAGS_input);
-  const std::string flags_output = mozc::GetFlag(FLAGS_output);
+  const std::string flags_profile_dir = absl::GetFlag(FLAGS_profile_dir);
+  const std::string flags_input = absl::GetFlag(FLAGS_input);
+  const std::string flags_output = absl::GetFlag(FLAGS_output);
 
   if (!flags_profile_dir.empty()) {
     // TODO(komatsu): Make a tmp dir and use it.
diff --git session/session_converter.cc session/session_converter.cc
index a0a4e8b0c..77ae3a28e 100644
--- session/session_converter.cc
+++ session/session_converter.cc
@@ -35,7 +35,6 @@
 #include <limits>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/text_normalizer.h"
@@ -53,6 +52,7 @@
 #include "session/session_usage_stats_util.h"
 #include "transliteration/transliteration.h"
 #include "usage_stats/usage_stats.h"
+#include "absl/flags/flag.h"
 
 using mozc::usage_stats::UsageStats;
 
@@ -62,7 +62,7 @@ const bool kDefaultUseActualConverterForRealtimeConversion = false;
 const bool kDefaultUseActualConverterForRealtimeConversion = true;
 #endif  // OS_ANDROID
 
-MOZC_FLAG(bool, use_actual_converter_for_realtime_conversion,
+ABSL_FLAG(bool, use_actual_converter_for_realtime_conversion,
           kDefaultUseActualConverterForRealtimeConversion,
           "If true, use the actual (non-immutable) converter for real "
           "time conversion.");
@@ -428,7 +428,7 @@ bool SessionConverter::SuggestWithPreferences(
     conversion_request.set_create_partial_candidates(
         request_->auto_partial_suggestion());
     conversion_request.set_use_actual_converter_for_realtime_conversion(
-        mozc::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
+        absl::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
     if (!converter_->StartSuggestionForRequest(conversion_request,
                                                segments_.get())) {
       // TODO(komatsu): Because suggestion is a prefix search, once
@@ -504,7 +504,7 @@ bool SessionConverter::PredictWithPreferences(
   if (predict_expand || predict_first) {
     ConversionRequest conversion_request(&composer, request_, config_);
     conversion_request.set_use_actual_converter_for_realtime_conversion(
-        mozc::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
+        absl::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
     if (!converter_->StartPredictionForRequest(conversion_request,
                                                segments_.get())) {
       LOG(WARNING) << "StartPredictionForRequest() failed";
@@ -576,7 +576,7 @@ bool SessionConverter::ExpandSuggestionWithPreferences(
     conversion_request.set_create_partial_candidates(
         request_->auto_partial_suggestion());
     conversion_request.set_use_actual_converter_for_realtime_conversion(
-        mozc::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
+        absl::GetFlag(FLAGS_use_actual_converter_for_realtime_conversion));
     // This is abuse of StartPrediction().
     // TODO(matsuzakit or yamaguchi): Add ExpandSuggestion method
     //    to Converter class.
diff --git session/session_converter.h session/session_converter.h
index b1ac98895..fe5614e55 100644
--- session/session_converter.h
+++ session/session_converter.h
@@ -395,7 +395,7 @@ class SessionConverter : public SessionConverterInterface {
   std::vector<int> selected_candidate_indices_;
 
   // Revision number of client context with which the converter determines when
-  // the history segments should be invalidated. See the implemenation of
+  // the history segments should be invalidated. See the implementation of
   // OnStartComposition for details.
   int32 client_revision_;
 
diff --git session/session_converter_interface.h session/session_converter_interface.h
index 32068a1ce..ba5b7f671 100644
--- session/session_converter_interface.h
+++ session/session_converter_interface.h
@@ -192,9 +192,9 @@ class SessionConverterInterface {
 
   // Commit prefix of the preedit string represented by Composer.
   // The caller should delete characters from composer based on returned
-  // |commited_size|.
+  // |committed_size|.
   virtual void CommitHead(size_t count, const composer::Composer &composer,
-                          size_t *commited_size) = 0;
+                          size_t *committed_size) = 0;
 
   // Revert the last "Commit" operation
   virtual void Revert() = 0;
diff --git session/session_converter_stress_test.cc session/session_converter_stress_test.cc
index cf112d022..36a4a2f7c 100644
--- session/session_converter_stress_test.cc
+++ session/session_converter_stress_test.cc
@@ -31,7 +31,6 @@
 #include <string>
 
 #include "base/clock.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "base/util.h"
@@ -45,13 +44,14 @@
 #include "session/session_converter.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, test_deterministic, true,
+ABSL_FLAG(bool, test_deterministic, true,
           "if true, srand() is initialized by \"test_srand_seed\"."
           "if false, srand() is initialized by current time "
           "and \"test_srand_seed\" is ignored");
 
-MOZC_FLAG(int32, test_srand_seed, 0,
+ABSL_FLAG(int32, test_srand_seed, 0,
           "seed number for srand(). "
           "used only when \"test_deterministic\" is true");
 
@@ -64,16 +64,16 @@ namespace session {
 class SessionConverterStressTest : public ::testing::Test {
  public:
   SessionConverterStressTest() {
-    if (!mozc::GetFlag(FLAGS_test_deterministic)) {
-      mozc::SetFlag(&FLAGS_test_srand_seed,
+    if (!absl::GetFlag(FLAGS_test_deterministic)) {
+      absl::SetFlag(&FLAGS_test_srand_seed,
                     static_cast<int32>(Clock::GetTime()));
     }
     Util::SetRandomSeed(
-        static_cast<uint32>(mozc::GetFlag(FLAGS_test_srand_seed)));
+        static_cast<uint32>(absl::GetFlag(FLAGS_test_srand_seed)));
   }
 
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     config::Config config;
     config::ConfigHandler::GetDefaultConfig(&config);
     config::ConfigHandler::SetConfig(config);
diff --git session/session_converter_test.cc session/session_converter_test.cc
index 8133d3dd1..d5c22add4 100644
--- session/session_converter_test.cc
+++ session/session_converter_test.cc
@@ -40,7 +40,6 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/util.h"
@@ -62,6 +61,7 @@
 #include "transliteration/transliteration.h"
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -86,7 +86,7 @@ class SessionConverterTest : public ::testing::Test {
 
   void SetUp() override {
     convertermock_ = absl::make_unique<ConverterMock>();
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     mozc::usage_stats::UsageStats::ClearAllStatsForTest();
 
     config_ = absl::make_unique<Config>();
@@ -352,13 +352,13 @@ class SessionConverterTest : public ::testing::Test {
   }
 
   static void SetCommandCandidate(Segments *segments, int segment_index,
-                                  int canidate_index,
+                                  int candidate_index,
                                   Segment::Candidate::Command command) {
     segments->mutable_conversion_segment(segment_index)
-        ->mutable_candidate(canidate_index)
+        ->mutable_candidate(candidate_index)
         ->attributes |= Segment::Candidate::COMMAND_CANDIDATE;
     segments->mutable_conversion_segment(segment_index)
-        ->mutable_candidate(canidate_index)
+        ->mutable_candidate(candidate_index)
         ->command = command;
   }
 
diff --git session/session_handler.cc session/session_handler.cc
index 176e75283..9132ed5eb 100644
--- session/session_handler.cc
+++ session/session_handler.cc
@@ -38,9 +38,9 @@
 #include <vector>
 
 #include "base/clock.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
+#include "absl/flags/flag.h"
 #ifndef MOZC_DISABLE_SESSION_WATCHDOG
 #include "base/process.h"
 #endif  // MOZC_DISABLE_SESSION_WATCHDOG
@@ -66,31 +66,31 @@
 
 using mozc::usage_stats::UsageStats;
 
-MOZC_FLAG(int32, timeout, -1,
+ABSL_FLAG(int32, timeout, -1,
           "server timeout. "
           "if sessions get empty for \"timeout\", "
           "shutdown message is automatically emitted");
 
-MOZC_FLAG(int32, max_session_size, 64,
+ABSL_FLAG(int32, max_session_size, 64,
           "maximum sessions size. "
           "if size of sessions reaches to \"max_session_size\", "
           "oldest session is removed");
 
-MOZC_FLAG(int32, create_session_min_interval, 0,
+ABSL_FLAG(int32, create_session_min_interval, 0,
           "minimum interval (sec) for create session");
 
-MOZC_FLAG(int32, watch_dog_interval, 180, "watch dog timer intaval (sec)");
+ABSL_FLAG(int32, watch_dog_interval, 180, "watch dog timer intaval (sec)");
 
-MOZC_FLAG(int32, last_command_timeout, 3600,
+ABSL_FLAG(int32, last_command_timeout, 3600,
           "remove session if it is not accessed for "
           "\"last_command_timeout\" sec");
 
-MOZC_FLAG(int32, last_create_session_timeout, 300,
+ABSL_FLAG(int32, last_create_session_timeout, 300,
           "remove session if it is not accessed for "
           "\"last_create_session_timeout\" sec "
           "after create session command");
 
-MOZC_FLAG(bool, restricted, false, "Launch server with restricted setting");
+ABSL_FLAG(bool, restricted, false, "Launch server with restricted setting");
 
 namespace mozc {
 
@@ -147,30 +147,30 @@ void SessionHandler::Init(
   request_ = absl::make_unique<commands::Request>();
   config_ = absl::make_unique<config::Config>();
 
-  if (mozc::GetFlag(FLAGS_restricted)) {
+  if (absl::GetFlag(FLAGS_restricted)) {
     VLOG(1) << "Server starts with restricted mode";
     // --restricted is almost always specified when mozc_client is inside Job.
     // The typical case is Startup processes on Vista.
     // On Vista, StartUp processes are in Job for 60 seconds. In order
     // to launch new mozc_server inside sandbox, we set the timeout
     // to be 60sec. Client application hopefully re-launch mozc_server.
-    mozc::SetFlag(&FLAGS_timeout, 60);
-    mozc::SetFlag(&FLAGS_max_session_size, 8);
-    mozc::SetFlag(&FLAGS_watch_dog_interval, 15);
-    mozc::SetFlag(&FLAGS_last_create_session_timeout, 60);
-    mozc::SetFlag(&FLAGS_last_command_timeout, 60);
+    absl::SetFlag(&FLAGS_timeout, 60);
+    absl::SetFlag(&FLAGS_max_session_size, 8);
+    absl::SetFlag(&FLAGS_watch_dog_interval, 15);
+    absl::SetFlag(&FLAGS_last_create_session_timeout, 60);
+    absl::SetFlag(&FLAGS_last_command_timeout, 60);
   }
 
 #ifndef MOZC_DISABLE_SESSION_WATCHDOG
   session_watch_dog_ = absl::make_unique<SessionWatchDog>(
-      mozc::GetFlag(FLAGS_watch_dog_interval));
+      absl::GetFlag(FLAGS_watch_dog_interval));
 #endif  // MOZC_DISABLE_SESSION_WATCHDOG
 
   config::ConfigHandler::GetConfig(config_.get());
 
   // allow [2..128] sessions
   max_session_size_ =
-      std::max(2, std::min(mozc::GetFlag(FLAGS_max_session_size), 128));
+      std::max(2, std::min(absl::GetFlag(FLAGS_max_session_size), 128));
   session_map_ = absl::make_unique<SessionMap>(max_session_size_);
 
   if (!engine_) {
@@ -493,7 +493,7 @@ bool SessionHandler::CreateSession(commands::Command *command) {
   // prevent DOS attack
   // don't allow CreateSession in very short period.
   const int create_session_minimum_interval =
-      std::max(0, std::min(mozc::GetFlag(FLAGS_create_session_min_interval),
+      std::max(0, std::min(absl::GetFlag(FLAGS_create_session_min_interval),
                            10));
 
   uint64 current_time = Clock::GetTime();
@@ -610,13 +610,13 @@ bool SessionHandler::Cleanup(commands::Command *command) {
   // allow [1..600] sec. default: 300
   const uint64 create_session_timeout =
       suspend_time +
-      std::max(1, std::min(mozc::GetFlag(FLAGS_last_create_session_timeout),
+      std::max(1, std::min(absl::GetFlag(FLAGS_last_create_session_timeout),
                            600));
 
   // allow [10..7200] sec. default 3600
   const uint64 last_command_timeout =
       suspend_time +
-      std::max(10, std::min(mozc::GetFlag(FLAGS_last_command_timeout), 7200));
+      std::max(10, std::min(absl::GetFlag(FLAGS_last_command_timeout), 7200));
 
   std::vector<SessionID> remove_ids;
   for (SessionElement *element =
@@ -649,9 +649,9 @@ bool SessionHandler::Cleanup(commands::Command *command) {
   engine_->GetUserDataManager()->Sync();
 
   // timeout is enabled.
-  if (mozc::GetFlag(FLAGS_timeout) > 0 && last_session_empty_time_ != 0 &&
+  if (absl::GetFlag(FLAGS_timeout) > 0 && last_session_empty_time_ != 0 &&
       (current_time - last_session_empty_time_) >=
-          suspend_time + mozc::GetFlag(FLAGS_timeout)) {
+          suspend_time + absl::GetFlag(FLAGS_timeout)) {
     Shutdown(command);
   }
 
diff --git session/session_handler.h session/session_handler.h
index 5f6d38912..8351e4e4c 100644
--- session/session_handler.h
+++ session/session_handler.h
@@ -83,7 +83,7 @@ class SessionHandler : public SessionHandlerInterface {
   // Starts watch dog timer to cleanup sessions.
   bool StartWatchDog() override;
 
-  // NewSession returns new Sessoin.
+  // NewSession returns new Session.
   // Client needs to delete it properly
   session::SessionInterface *NewSession();
 
diff --git session/session_handler_main.cc session/session_handler_main.cc
index acd9e34cf..a2cc71536 100644
--- session/session_handler_main.cc
+++ session/session_handler_main.cc
@@ -56,7 +56,6 @@ SHOW_LOG_BY_VALUE       ございました
 #include <string>
 
 #include "base/file_stream.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/status.h"
 #include "base/system_util.h"
@@ -66,12 +65,14 @@ SHOW_LOG_BY_VALUE       ございました
 #include "engine/engine.h"
 #include "protocol/commands.pb.h"
 #include "session/session_handler_tool.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/str_split.h"
 
-MOZC_FLAG(string, input, "", "Input file");
-MOZC_FLAG(string, profile, "", "User profile directory");
-MOZC_FLAG(string, engine, "", "Conversion engine: 'mobile' or 'desktop'");
-MOZC_FLAG(string, dictionary, "", "Dictionary: 'google', 'android' or 'oss'");
+ABSL_FLAG(std::string, input, "", "Input file");
+ABSL_FLAG(std::string, profile, "", "User profile directory");
+ABSL_FLAG(std::string, engine, "", "Conversion engine: 'mobile' or 'desktop'");
+ABSL_FLAG(std::string, dictionary, "",
+          "Dictionary: 'google', 'android' or 'oss'");
 
 namespace mozc {
 void Show(const commands::Output &output) {
@@ -175,11 +176,11 @@ mozc::StatusOr<std::unique_ptr<Engine>> CreateEngine(
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  if (!mozc::GetFlag(FLAGS_profile).empty()) {
-    mozc::SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_profile));
+  if (!absl::GetFlag(FLAGS_profile).empty()) {
+    mozc::SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_profile));
   }
-  auto engine = mozc::CreateEngine(mozc::GetFlag(FLAGS_engine),
-                                   mozc::GetFlag(FLAGS_dictionary));
+  auto engine = mozc::CreateEngine(absl::GetFlag(FLAGS_engine),
+                                   absl::GetFlag(FLAGS_dictionary));
   if (!engine.ok()) {
     std::cout << "engine init error" << std::endl;
     return 1;
@@ -187,8 +188,8 @@ int main(int argc, char **argv) {
   mozc::session::SessionHandlerInterpreter handler(*std::move(engine));
 
   std::string line;
-  if (!mozc::GetFlag(FLAGS_input).empty()) {
-    mozc::InputFileStream input(mozc::GetFlag(FLAGS_input).c_str());
+  if (!absl::GetFlag(FLAGS_input).empty()) {
+    mozc::InputFileStream input(absl::GetFlag(FLAGS_input).c_str());
     while (std::getline(input, line)) {
       mozc::ParseLine(handler, line);
     }
diff --git session/session_handler_stress_test.cc session/session_handler_stress_test.cc
index f54e42016..22cf72891 100644
--- session/session_handler_stress_test.cc
+++ session/session_handler_stress_test.cc
@@ -33,7 +33,6 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "engine/engine_factory.h"
 #include "protocol/commands.pb.h"
@@ -42,6 +41,7 @@
 #include "session/session_handler_tool.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace {
 uint32 GenerateRandomSeed() {
@@ -52,7 +52,7 @@ uint32 GenerateRandomSeed() {
 }  // namespace
 
 // There is no DEFINE_uint32.
-MOZC_FLAG(uint64, random_seed, GenerateRandomSeed(),
+ABSL_FLAG(uint64, random_seed, GenerateRandomSeed(),
           "Random seed value. "
           "This value will be interpreted as uint32.");
 
@@ -71,7 +71,7 @@ TEST(SessionHandlerStressTest, BasicStressTest) {
   ASSERT_TRUE(client.CreateSession());
 
   const uint32 random_seed =
-      static_cast<uint32>(mozc::GetFlag(FLAGS_random_seed));
+      static_cast<uint32>(absl::GetFlag(FLAGS_random_seed));
   LOG(INFO) << "Random seed: " << random_seed;
   session::RandomKeyEventsGenerator::InitSeed(random_seed);
   while (keyevents_size < kMaxEventSize) {
diff --git session/session_handler_test.cc session/session_handler_test.cc
index 281ef0e90..92abaa457 100644
--- session/session_handler_test.cc
+++ session/session_handler_test.cc
@@ -36,7 +36,6 @@
 #include <vector>
 
 #include "base/clock_mock.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "config/config_handler.h"
@@ -53,12 +52,14 @@
 #include "testing/base/public/gunit.h"
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
-MOZC_DECLARE_FLAG(int32, max_session_size);
-MOZC_DECLARE_FLAG(int32, create_session_min_interval);
-MOZC_DECLARE_FLAG(int32, last_command_timeout);
-MOZC_DECLARE_FLAG(int32, last_create_session_timeout);
+ABSL_DECLARE_FLAG(int32, max_session_size);
+ABSL_DECLARE_FLAG(int32, create_session_min_interval);
+ABSL_DECLARE_FLAG(int32, last_command_timeout);
+ABSL_DECLARE_FLAG(int32, last_create_session_timeout);
 
 namespace mozc {
 
@@ -197,13 +198,13 @@ class SessionHandlerTest : public SessionHandlerTestBase {
 TEST_F(SessionHandlerTest, MaxSessionSizeTest) {
   uint32 expected_session_created_num = 0;
   const int32 interval_time = 10;  // 10 sec
-  mozc::SetFlag(&FLAGS_create_session_min_interval, interval_time);
+  absl::SetFlag(&FLAGS_create_session_min_interval, interval_time);
   ClockMock clock(1000, 0);
   Clock::SetClockForUnitTest(&clock);
 
   // The oldest item is removed
   const size_t session_size = 3;
-  mozc::SetFlag(&FLAGS_max_session_size, static_cast<int32>(session_size));
+  absl::SetFlag(&FLAGS_max_session_size, static_cast<int32>(session_size));
   {
     SessionHandler handler(CreateMockDataEngine());
 
@@ -227,7 +228,7 @@ TEST_F(SessionHandlerTest, MaxSessionSizeTest) {
     }
   }
 
-  mozc::SetFlag(&FLAGS_max_session_size, static_cast<int32>(session_size));
+  absl::SetFlag(&FLAGS_max_session_size, static_cast<int32>(session_size));
   {
     SessionHandler handler(CreateMockDataEngine());
 
@@ -265,7 +266,7 @@ TEST_F(SessionHandlerTest, MaxSessionSizeTest) {
 
 TEST_F(SessionHandlerTest, CreateSessionMinInterval) {
   const int32 interval_time = 10;  // 10 sec
-  mozc::SetFlag(&FLAGS_create_session_min_interval, interval_time);
+  absl::SetFlag(&FLAGS_create_session_min_interval, interval_time);
   ClockMock clock(1000, 0);
   Clock::SetClockForUnitTest(&clock);
 
@@ -286,7 +287,7 @@ TEST_F(SessionHandlerTest, CreateSessionMinInterval) {
 
 TEST_F(SessionHandlerTest, LastCreateSessionTimeout) {
   const int32 timeout = 10;  // 10 sec
-  mozc::SetFlag(&FLAGS_last_create_session_timeout, timeout);
+  absl::SetFlag(&FLAGS_last_create_session_timeout, timeout);
   ClockMock clock(1000, 0);
   Clock::SetClockForUnitTest(&clock);
 
@@ -306,7 +307,7 @@ TEST_F(SessionHandlerTest, LastCreateSessionTimeout) {
 
 TEST_F(SessionHandlerTest, LastCommandTimeout) {
   const int32 timeout = 10;  // 10 sec
-  mozc::SetFlag(&FLAGS_last_command_timeout, timeout);
+  absl::SetFlag(&FLAGS_last_command_timeout, timeout);
   ClockMock clock(1000, 0);
   Clock::SetClockForUnitTest(&clock);
 
diff --git session/session_handler_test_util.cc session/session_handler_test_util.cc
index ce3a30596..dd94c41d0 100644
--- session/session_handler_test_util.cc
+++ session/session_handler_test_util.cc
@@ -33,7 +33,6 @@
 
 #include "base/config_file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "config/character_form_manager.h"
@@ -47,13 +46,15 @@
 #include "session/session_usage_observer.h"
 #include "storage/registry.h"
 #include "testing/base/public/googletest.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
-MOZC_DECLARE_FLAG(int32, max_session_size);
-MOZC_DECLARE_FLAG(int32, create_session_min_interval);
-MOZC_DECLARE_FLAG(int32, watch_dog_interval);
-MOZC_DECLARE_FLAG(int32, last_command_timeout);
-MOZC_DECLARE_FLAG(int32, last_create_session_timeout);
-MOZC_DECLARE_FLAG(bool, restricted);
+ABSL_DECLARE_FLAG(int32, max_session_size);
+ABSL_DECLARE_FLAG(int32, create_session_min_interval);
+ABSL_DECLARE_FLAG(int32, watch_dog_interval);
+ABSL_DECLARE_FLAG(int32, last_command_timeout);
+ABSL_DECLARE_FLAG(int32, last_create_session_timeout);
+ABSL_DECLARE_FLAG(bool, restricted);
 
 namespace mozc {
 namespace session {
@@ -110,18 +111,18 @@ SessionHandlerTestBase::SessionHandlerTestBase() {}
 SessionHandlerTestBase::~SessionHandlerTestBase() {}
 
 void SessionHandlerTestBase::SetUp() {
-  flags_max_session_size_backup_ = mozc::GetFlag(FLAGS_max_session_size);
+  flags_max_session_size_backup_ = absl::GetFlag(FLAGS_max_session_size);
   flags_create_session_min_interval_backup_ =
-      mozc::GetFlag(FLAGS_create_session_min_interval);
-  flags_watch_dog_interval_backup_ = mozc::GetFlag(FLAGS_watch_dog_interval);
+      absl::GetFlag(FLAGS_create_session_min_interval);
+  flags_watch_dog_interval_backup_ = absl::GetFlag(FLAGS_watch_dog_interval);
   flags_last_command_timeout_backup_ =
-      mozc::GetFlag(FLAGS_last_command_timeout);
+      absl::GetFlag(FLAGS_last_command_timeout);
   flags_last_create_session_timeout_backup_ =
-      mozc::GetFlag(FLAGS_last_create_session_timeout);
-  flags_restricted_backup_ = mozc::GetFlag(FLAGS_restricted);
+      absl::GetFlag(FLAGS_last_create_session_timeout);
+  flags_restricted_backup_ = absl::GetFlag(FLAGS_restricted);
 
   user_profile_directory_backup_ = SystemUtil::GetUserProfileDirectory();
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   ConfigHandler::GetConfig(&config_backup_);
   ClearState();
 }
@@ -131,15 +132,15 @@ void SessionHandlerTestBase::TearDown() {
   ConfigHandler::SetConfig(config_backup_);
   SystemUtil::SetUserProfileDirectory(user_profile_directory_backup_);
 
-  mozc::SetFlag(&FLAGS_max_session_size, flags_max_session_size_backup_);
-  mozc::SetFlag(&FLAGS_create_session_min_interval,
+  absl::SetFlag(&FLAGS_max_session_size, flags_max_session_size_backup_);
+  absl::SetFlag(&FLAGS_create_session_min_interval,
                 flags_create_session_min_interval_backup_);
-  mozc::SetFlag(&FLAGS_watch_dog_interval, flags_watch_dog_interval_backup_);
-  mozc::SetFlag(&FLAGS_last_command_timeout,
+  absl::SetFlag(&FLAGS_watch_dog_interval, flags_watch_dog_interval_backup_);
+  absl::SetFlag(&FLAGS_last_command_timeout,
                 flags_last_command_timeout_backup_);
-  mozc::SetFlag(&FLAGS_last_create_session_timeout,
+  absl::SetFlag(&FLAGS_last_create_session_timeout,
                 flags_last_create_session_timeout_backup_);
-  mozc::SetFlag(&FLAGS_restricted, flags_restricted_backup_);
+  absl::SetFlag(&FLAGS_restricted, flags_restricted_backup_);
 }
 
 void SessionHandlerTestBase::ClearState() {
diff --git session/session_regression_test.cc session/session_regression_test.cc
index 2d64e9010..2b806fab3 100644
--- session/session_regression_test.cc
+++ session/session_regression_test.cc
@@ -35,7 +35,6 @@
 #include <utility>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/system_util.h"
@@ -58,9 +57,11 @@
 #include "session/session_handler.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
-MOZC_DECLARE_FLAG(bool, use_history_rewriter);
+ABSL_DECLARE_FLAG(bool, use_history_rewriter);
 
 namespace mozc {
 namespace {
@@ -91,10 +92,10 @@ void InitSessionToPrecomposition(session::Session *session) {
 class SessionRegressionTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
-    orig_use_history_rewriter_ = mozc::GetFlag(FLAGS_use_history_rewriter);
-    mozc::SetFlag(&FLAGS_use_history_rewriter, true);
+    orig_use_history_rewriter_ = absl::GetFlag(FLAGS_use_history_rewriter);
+    absl::SetFlag(&FLAGS_use_history_rewriter, true);
 
     // Note: engine must be created after setting all the flags, as it
     // internally depends on global flags, e.g., for creation of rewriters.
@@ -117,7 +118,7 @@ class SessionRegressionTest : public ::testing::Test {
     config::ConfigHandler::GetDefaultConfig(&config);
     config::ConfigHandler::SetConfig(config);
 
-    mozc::SetFlag(&FLAGS_use_history_rewriter, orig_use_history_rewriter_);
+    absl::SetFlag(&FLAGS_use_history_rewriter, orig_use_history_rewriter_);
   }
 
   bool SendKey(const std::string &key, commands::Command *command) {
@@ -215,7 +216,7 @@ TEST_F(SessionRegressionTest, ConvertToTransliterationWithMultipleSegments) {
 }
 
 TEST_F(SessionRegressionTest,
-       ExitTemporaryAlphanumModeAfterCommitingSugesstion) {
+       ExitTemporaryAlphanumModeAfterCommittingSugesstion) {
   // This is a regression test against http://b/2977131.
   {
     InitSessionToPrecomposition(session_.get());
@@ -247,7 +248,7 @@ TEST_F(SessionRegressionTest, HistoryLearning) {
   std::string candidate1;
   std::string candidate2;
 
-  {  // First session.  Second candidate is commited.
+  {  // First session.  Second candidate is committed.
     InsertCharacterChars("kanji", &command);
 
     command.Clear();
diff --git session/session_server_main.cc session/session_server_main.cc
index e9eae5b1c..4956d517d 100644
--- session/session_server_main.cc
+++ session/session_server_main.cc
@@ -30,10 +30,10 @@
 // Mocked Session Server runner used just for testing.
 #include <cstdio>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "protocol/commands.pb.h"
 #include "session/session_server.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/str_format.h"
 
 static const int kMaxBufSize = 1024;
diff --git session/session_server_test.cc session/session_server_test.cc
index 3b1439113..7a64d543f 100644
--- session/session_server_test.cc
+++ session/session_server_test.cc
@@ -33,11 +33,11 @@
 #include <string>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/scheduler.h"
 #include "base/system_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace {
@@ -68,7 +68,7 @@ class JobRecorder : public Scheduler::SchedulerInterface {
 class SessionServerTest : public testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
   }
 };
 
diff --git session/session_test.cc session/session_test.cc
index c7c1296bc..2c44228b5 100644
--- session/session_test.cc
+++ session/session_test.cc
@@ -3212,7 +3212,7 @@ TEST_F(SessionTest, SpaceOnAlphanumeric) {
 
   {
     request.set_space_on_alphanumeric(
-        commands::Request::SPACE_OR_CONVERT_COMMITING_COMPOSITION);
+        commands::Request::SPACE_OR_CONVERT_COMMITTING_COMPOSITION);
 
     Session session(engine_.get());
     InitSessionToPrecomposition(&session, request);
@@ -3687,7 +3687,7 @@ TEST_F(SessionTest, InsertCharacterWithShiftKey) {
   }
 }
 
-TEST_F(SessionTest, ExitTemporaryAlphanumModeAfterCommitingSugesstion) {
+TEST_F(SessionTest, ExitTemporaryAlphanumModeAfterCommittingSugesstion) {
   // This is a unittest against http://b/2977131.
   {
     std::unique_ptr<Session> session(new Session(engine_.get()));
@@ -8638,7 +8638,7 @@ TEST_F(SessionTest, CancelInPasswordMode_Issue5955618) {
     InitSessionToConversionWithAiueo(&session);
     SwitchInputFieldType(commands::Context::PASSWORD, &session);
 
-    // Actualy this works well because Cancel command in conversion mode
+    // Actually this works well because Cancel command in conversion mode
     // is mapped into ConvertCancel not EditCancel.
     commands::Command command;
     EXPECT_TRUE(TestSendKey("ESC", &session, &command));
@@ -8664,7 +8664,7 @@ TEST_F(SessionTest, CancelInPasswordMode_Issue5955618) {
     SetupMockForReverseConversion("[MO]", "MO");
     EXPECT_TRUE(session.SendCommand(&command));
 
-    // Actualy this works well because Cancel command in conversion mode
+    // Actually this works well because Cancel command in conversion mode
     // is mapped into ConvertCancel not EditCancel.
     EXPECT_TRUE(TestSendKey("ESC", &session, &command));
     EXPECT_TRUE(command.output().consumed());
@@ -8890,7 +8890,7 @@ TEST_F(SessionTest, SuppressSuggestion) {
   SendKey("d", &session, &command);
   EXPECT_TRUE(command.output().has_candidates());
 
-  // With an invalid identifer.  It should be the same with the
+  // With an invalid identifier.  It should be the same with the
   // default behavior.
   SetSendKeyCommand("i", &command);
   command.mutable_input()->mutable_context()->add_experimental_features(
diff --git session/session_usage_observer.cc session/session_usage_observer.cc
index e78135318..42ac1f3c3 100644
--- session/session_usage_observer.cc
+++ session/session_usage_observer.cc
@@ -101,13 +101,13 @@ bool IsSessionIndependentCommand(commands::Input::CommandType type) {
 }  // namespace
 
 SessionUsageObserver::SessionUsageObserver() {
-  // Explicitly calls Sync() to delete usage stats existing data inlcuding
+  // Explicitly calls Sync() to delete usage stats existing data including
   // metadata for migration.
   UsageStats::Sync();
 }
 
 SessionUsageObserver::~SessionUsageObserver() {
-  // Explicitly calls Sync() to delete usage stats existing data inlcuding
+  // Explicitly calls Sync() to delete usage stats existing data including
   // metadata for migration.
   UsageStats::Sync();
 }
diff --git session/session_usage_observer.h session/session_usage_observer.h
index 0667e77d1..ba754fa1e 100644
--- session/session_usage_observer.h
+++ session/session_usage_observer.h
@@ -103,7 +103,7 @@ class SessionUsageObserver : public SessionObserverInterface {
 
   // last_touchevents_ is used to keep the touch_events of last SEND_KEY
   // message.
-  // When the subsequent command will be recieved, if the command is BACKSPACE
+  // When the subsequent command will be received, if the command is BACKSPACE
   // last_touchevents_ will be aggregated to miss_touch_event_stat_cache_,
   // if the command is not BACKSPACE last_touchevents_ will be aggregated to
   // touch_event_stat_cache_.
diff --git session/session_usage_observer_test.cc session/session_usage_observer_test.cc
index 337a910f7..1b858e880 100644
--- session/session_usage_observer_test.cc
+++ session/session_usage_observer_test.cc
@@ -34,7 +34,6 @@
 
 #include "base/clock.h"
 #include "base/clock_mock.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/scheduler.h"
 #include "base/scheduler_stub.h"
@@ -48,6 +47,7 @@
 #include "usage_stats/usage_stats.h"
 #include "usage_stats/usage_stats.pb.h"
 #include "usage_stats/usage_stats_testing_util.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 using mozc::usage_stats::Stats;
@@ -59,7 +59,7 @@ namespace session {
 class SessionUsageObserverTest : public testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     UsageStats::ClearAllStatsForTest();
 
     Clock::SetClockForUnitTest(nullptr);
diff --git storage/BUILD storage/BUILD
index 5d55b0a8e..93fa640f1 100644
--- storage/BUILD
+++ storage/BUILD
@@ -109,11 +109,11 @@ cc_test_mozc(
         "//base:clock_mock",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -161,9 +161,9 @@ cc_test_mozc(
         ":tiny_storage",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:port",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings:str_format",
     ],
 )
@@ -216,9 +216,9 @@ cc_test_mozc(
     deps = [
         ":registry",
         "//base",
-        "//base:flags",
         "//base:system_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -246,10 +246,10 @@ cc_test_mozc(
         ":encrypted_string_storage",
         "//base:file_stream",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:system_util",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/memory",
     ],
 )
diff --git storage/encrypted_string_storage_test.cc storage/encrypted_string_storage_test.cc
index 0ddaeb456..c4e0b4d8e 100644
--- storage/encrypted_string_storage_test.cc
+++ storage/encrypted_string_storage_test.cc
@@ -34,11 +34,11 @@
 
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/memory/memory.h"
 
 namespace mozc {
@@ -82,7 +82,7 @@ typedef EncryptedStringStorage TestEncryptedStringStorage;
 class EncryptedStringStorageTest : public testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     filename_ = FileUtil::JoinPath(SystemUtil::GetUserProfileDirectory(),
                                    "encrypted_string_storage_for_test.db");
 
@@ -122,7 +122,7 @@ TEST_F(EncryptedStringStorageTest, Encrypt) {
   ASSERT_TRUE(ifs.eof());
   const std::string result(buf, read_size);
 
-  // Saved stirng is longer than original string since it has some data
+  // Saved string is longer than original string since it has some data
   // used for encryption.
   EXPECT_LT(original_data.size(), result.size());
   EXPECT_TRUE(result.find(original_data) == std::string::npos);
diff --git storage/existence_filter_main.cc storage/existence_filter_main.cc
index e2731b4a0..cfdcda837 100644
--- storage/existence_filter_main.cc
+++ storage/existence_filter_main.cc
@@ -29,12 +29,12 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "storage/existence_filter.h"
+#include "absl/flags/flag.h"
 
 using mozc::storage::ExistenceFilter;
 
diff --git storage/lru_cache_main.cc storage/lru_cache_main.cc
index 61372ec23..e8a8e33e6 100644
--- storage/lru_cache_main.cc
+++ storage/lru_cache_main.cc
@@ -30,10 +30,10 @@
 #include <iostream>  // NOLINT
 #include <string>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/util.h"
 #include "storage/lru_cache.h"
+#include "absl/flags/flag.h"
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
diff --git storage/lru_storage.h storage/lru_storage.h
index 03e31af5c..4a85c4502 100644
--- storage/lru_storage.h
+++ storage/lru_storage.h
@@ -54,7 +54,7 @@ class LRUStorage {
   bool Open(const char *filename);
   void Close();
 
-  // Try to open exisiting database
+  // Try to open existing database
   // If the file is broken or cannot open, tries to recreate
   // new file
   bool OpenOrCreate(const char *filename, size_t new_value_size,
diff --git storage/lru_storage_main.cc storage/lru_storage_main.cc
index 7dd758ab0..92d5b9276 100644
--- storage/lru_storage_main.cc
+++ storage/lru_storage_main.cc
@@ -29,29 +29,29 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "storage/lru_storage.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, create_db, false, "initialize database");
-MOZC_FLAG(string, file, "test.db", "");
-MOZC_FLAG(int32, size, 10, "size");
+ABSL_FLAG(bool, create_db, false, "initialize database");
+ABSL_FLAG(std::string, file, "test.db", "");
+ABSL_FLAG(int32, size, 10, "size");
 
 using mozc::storage::LRUStorage;
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
 
-  if (mozc::GetFlag(FLAGS_create_db)) {
+  if (absl::GetFlag(FLAGS_create_db)) {
     CHECK(LRUStorage::CreateStorageFile(FLAGS_file.c_str(),
                                         static_cast<uint32>(4),
-                                        mozc::GetFlag(FLAGS_size), 0xff02));
+                                        absl::GetFlag(FLAGS_size), 0xff02));
   }
 
   LRUStorage s;
-  CHECK(s.Open(mozc::GetFlag(FLAGS_file).c_str()));
+  CHECK(s.Open(absl::GetFlag(FLAGS_file).c_str()));
 
   LOG(INFO) << "size=" << s.size();
   LOG(INFO) << "used_size=" << s.used_size();
diff --git storage/lru_storage_test.cc storage/lru_storage_test.cc
index 90f3c189c..37dfd2f1d 100644
--- storage/lru_storage_test.cc
+++ storage/lru_storage_test.cc
@@ -38,13 +38,13 @@
 #include "base/clock_mock.h"
 #include "base/file_stream.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/port.h"
 #include "base/util.h"
 #include "storage/lru_cache.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace storage {
@@ -137,7 +137,7 @@ class LRUStorageTest : public ::testing::Test {
 
   static std::string GetTemporaryFilePath() {
     // This name should be unique to each test.
-    return FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir),
+    return FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir),
                               "LRUStorageTest_test.db");
   }
 
@@ -245,7 +245,7 @@ TEST_F(LRUStorageTest, Merge) {
 
   {
     // Need to mock clock because old entries are removed on Open.  The maximum
-    // timestmap set below is 50, so set the current time to 100.
+    // timestamp set below is 50, so set the current time to 100.
     ScopedClockMock clock(100, 0);
 
     LRUStorage::CreateStorageFile(file1.c_str(), 4, 8, kSeed);
@@ -288,7 +288,7 @@ TEST_F(LRUStorageTest, Merge) {
   // same FP
   {
     // Need to mock clock because old entries are removed on Open.  The maximum
-    // timestmap set below is 50, so set the current time to 100.
+    // timestamp set below is 50, so set the current time to 100.
     ScopedClockMock clock(100, 0);
 
     LRUStorage::CreateStorageFile(file1.c_str(), 4, 8, kSeed);
diff --git storage/registry_test.cc storage/registry_test.cc
index 4e14d9616..a4c3d11ca 100644
--- storage/registry_test.cc
+++ storage/registry_test.cc
@@ -31,16 +31,16 @@
 
 #include <string>
 
-#include "base/flags.h"
 #include "base/system_util.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace storage {
 
 TEST(RegistryTest, TinyStorageTest) {
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 
   {
     uint64 value = 20;
diff --git storage/storage_interface.h storage/storage_interface.h
index c691a733d..3b6524adf 100644
--- storage/storage_interface.h
+++ storage/storage_interface.h
@@ -56,15 +56,15 @@ class StorageInterface {
 
   // Looks up key and returns the value.
   // If key is not found, returns false.
-  // It is not guranteed that the data is synced to the disk.
+  // It is not guaranteed that the data is synced to the disk.
   virtual bool Lookup(const std::string &key, std::string *value) const = 0;
 
   // Inserts key and value.
-  // It is not guranteed that the data is synced to the disk.
+  // It is not guaranteed that the data is synced to the disk.
   virtual bool Insert(const std::string &key, const std::string &value) = 0;
 
   // Erases the key-value pair specified by |key|.
-  // It is not guranteed that the data is synced to the disk
+  // It is not guaranteed that the data is synced to the disk
   virtual bool Erase(const std::string &key) = 0;
 
   // clears internal keys and values
diff --git storage/tiny_storage.h storage/tiny_storage.h
index 6bbcdb8c0..3a9c1c7b7 100644
--- storage/tiny_storage.h
+++ storage/tiny_storage.h
@@ -42,7 +42,7 @@ namespace storage {
 // We will replace it with faster and more robust implementation.
 class TinyStorage {
  public:
-  // Returns an implementatoin of StorageInterface.
+  // Returns an implementation of StorageInterface.
   // Caller must take ownership of the returned object.
   // Returns NULL if fails.
   static StorageInterface *New();
diff --git storage/tiny_storage_test.cc storage/tiny_storage_test.cc
index e8f5a3a32..755ecca00 100644
--- storage/tiny_storage_test.cc
+++ storage/tiny_storage_test.cc
@@ -37,11 +37,11 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/port.h"
 #include "storage/storage_interface.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/str_format.h"
 
 namespace mozc {
@@ -80,7 +80,7 @@ class TinyStorageTest : public testing::Test {
 
   static std::string GetTemporaryFilePath() {
     // This name should be unique to each test.
-    return FileUtil::JoinPath(mozc::GetFlag(FLAGS_test_tmpdir),
+    return FileUtil::JoinPath(absl::GetFlag(FLAGS_test_tmpdir),
                               "TinyStorageTest_test.db");
   }
 
diff --git testing/BUILD testing/BUILD
index b840b33c0..2aed40512 100644
--- testing/BUILD
+++ testing/BUILD
@@ -77,7 +77,7 @@ cc_library_mozc(
     deps = [
         ":gunit",
         "//base",
-        "//base:flags",
+        "@com_google_absl//absl/flags:flag",
     ] + select_mozc(
         client = [
             "//base:init_mozc",
@@ -154,7 +154,7 @@ cc_library_mozc(
             "//base",
             "//base:logging",
             "//base:file_util",
-            "//base:flags",
+            "@com_google_absl//absl/flags:flag",
             "//base:util",
         ],
         default = ["//testing/base/public:gunit_for_library_testonly"],
@@ -173,11 +173,11 @@ cc_library_mozc(
         ":googletest",
         "//base",
         "//base:file_util",
-        "//base:flags",
         "//base:logging",
         "//base:port",
         "//base:system_util",
         "//base:util",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings",
     ],
 )
diff --git testing/base/internal/googletest.cc testing/base/internal/googletest.cc
index a3610a2f4..e64ce2448 100644
--- testing/base/internal/googletest.cc
+++ testing/base/internal/googletest.cc
@@ -40,17 +40,18 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/util.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, test_srcdir, "",
+ABSL_FLAG(std::string, test_srcdir, "",
           "A directory that contains the input data files for a test.");
 
-MOZC_FLAG(string, test_tmpdir, "",
+ABSL_FLAG(std::string, test_tmpdir, "",
           "Directory for all temporary testing files.");
 
-MOZC_DECLARE_FLAG(string, program_invocation_name);
+ABSL_DECLARE_FLAG(string, program_invocation_name);
 
 namespace mozc {
 namespace {
@@ -95,7 +96,7 @@ string GetTestTmpdir() {
 // directory information. E.g like "/spam/eggs/foo_unittest".
 string GetProgramPath() {
   const string& program_invocation_name =
-      mozc::GetFlag(FLAGS_program_invocation_name);
+      absl::GetFlag(FLAGS_program_invocation_name);
   if (program_invocation_name.empty() || program_invocation_name[0] == '/') {
     return program_invocation_name;
   }
@@ -144,11 +145,11 @@ string GetTestTmpdir() {
 }  // namespace
 
 void InitTestFlags() {
-  if (mozc::GetFlag(FLAGS_test_srcdir).empty()) {
-    mozc::SetFlag(&FLAGS_test_srcdir, GetTestSrcdir());
+  if (absl::GetFlag(FLAGS_test_srcdir).empty()) {
+    absl::SetFlag(&FLAGS_test_srcdir, GetTestSrcdir());
   }
-  if (mozc::GetFlag(FLAGS_test_tmpdir).empty()) {
-    mozc::SetFlag(&FLAGS_test_tmpdir, GetTestTmpdir());
+  if (absl::GetFlag(FLAGS_test_tmpdir).empty()) {
+    absl::SetFlag(&FLAGS_test_tmpdir, GetTestTmpdir());
   }
 }
 
diff --git testing/base/internal/gtest_main.cc testing/base/internal/gtest_main.cc
index b6666ff0d..b753339b3 100644
--- testing/base/internal/gtest_main.cc
+++ testing/base/internal/gtest_main.cc
@@ -28,10 +28,10 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
+#include "absl/flags/flag.h"
 
 int main(int argc, char **argv) {
   // TODO(yukawa, team): Implement b/2805528 so that you can specify any option
diff --git testing/base/public/googletest.h testing/base/public/googletest.h
index ed1fa238d..2fa5513aa 100644
--- testing/base/public/googletest.h
+++ testing/base/public/googletest.h
@@ -30,7 +30,8 @@
 #ifndef MOZC_TESTING_BASE_PUBLIC_GOOGLETEST_H_
 #define MOZC_TESTING_BASE_PUBLIC_GOOGLETEST_H_
 
-#include "base/flags.h"
+#include "absl/flags/declare.h"
+#include "absl/flags/flag.h"
 
 // gunit doesn't expose test_srcdir and test_tmpdir on mobile platforms like
 // Android.
@@ -38,13 +39,13 @@
 // --test_srcdir is the path to a directory that contains the input data files
 // for a test, so that each entry in the 'data' section of the BUILD rule for
 // this test specifies a path relative to FLAGS_test_srcdir.
-MOZC_DECLARE_FLAG(string, test_srcdir);
+ABSL_DECLARE_FLAG(std::string, test_srcdir);
 
 // --test_tmpdir is a temporary directory that you can write to from inside a
 // test.  Files you write will eventually be cleaned up but you can see them at
 // ~/local/tmp in the immediate aftermath of the test.  These files are
 // stored on local disk, not on the networked filer.
-MOZC_DECLARE_FLAG(string, test_tmpdir);
+ABSL_DECLARE_FLAG(std::string, test_tmpdir);
 
 namespace mozc {
 // Initialize FLAGS_test_srcdir and FLAGS_test_tmpdir.
diff --git testing/base/public/mozctest.cc testing/base/public/mozctest.cc
index 6e30fc48f..25f42c379 100644
--- testing/base/public/mozctest.cc
+++ testing/base/public/mozctest.cc
@@ -30,18 +30,18 @@
 #include "testing/base/public/mozctest.h"
 
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/util.h"
 #include "testing/base/public/googletest.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/string_view.h"
 
 namespace mozc {
 namespace testing {
 
 std::string GetSourcePath(const std::vector<absl::string_view> &components) {
-  const std::string test_srcdir = mozc::GetFlag(FLAGS_test_srcdir);
+  const std::string test_srcdir = absl::GetFlag(FLAGS_test_srcdir);
   std::vector<absl::string_view> abs_components = { test_srcdir };
 
   const char *workspace = std::getenv("TEST_WORKSPACE");
@@ -83,7 +83,7 @@ std::vector<std::string> GetSourceFilesInDirOrDie(
 
 ScopedTmpUserProfileDirectory::ScopedTmpUserProfileDirectory()
     : original_dir_(SystemUtil::GetUserProfileDirectory()) {
-  SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+  SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
 }
 
 ScopedTmpUserProfileDirectory::~ScopedTmpUserProfileDirectory() {
diff --git tools/build_defs/qt.bzl tools/build_defs/qt.bzl
index 0a1ee34e8..14e676b47 100644
--- tools/build_defs/qt.bzl
+++ tools/build_defs/qt.bzl
@@ -117,7 +117,7 @@ def macos_qt_application_mozc(name, bundle_name, deps):
         app_icons = ["//data/images/mac:product_icon.icns"],
         bundle_id = MACOS_BUNDLE_ID_PREFIX + ".Tool." + bundle_name,
         bundle_name = bundle_name,
-        infoplists = ["//gui:gen_mozc_tool_info_plist"],
+        infoplists = ["//gui:mozc_tool_info_plist"],
         minimum_os_version = MACOS_MIN_OS_VER,
         resources = ["//data/images/mac:candidate_window_logo.tiff"],
         visibility = ["//:__subpackages__"],
diff --git tools/cc_target_os/BUILD tools/cc_target_os/BUILD
index 6a6ac82d2..ee11dd19b 100644
--- tools/cc_target_os/BUILD
+++ tools/cc_target_os/BUILD
@@ -104,3 +104,10 @@ config_setting(
         "define": "TARGET=wasm",
     },
 )
+
+config_setting(
+    name = "windows",
+    values = {
+        "define": "TARGET=windows",
+    },
+)
diff --git unix/emacs/BUILD unix/emacs/BUILD
index f73fd970a..bc1224a48 100644
--- unix/emacs/BUILD
+++ unix/emacs/BUILD
@@ -48,7 +48,6 @@ cc_binary_mozc(
     deps = [
         ":mozc_emacs_helper_lib",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
         "//base:logging",
         "//base:util",
@@ -57,6 +56,7 @@ cc_binary_mozc(
         "//config:config_handler",
         "//ipc",
         "//protocol:commands_proto",
+        "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/strings:str_format",
     ],
 )
diff --git unix/emacs/mozc_emacs_helper.cc unix/emacs/mozc_emacs_helper.cc
index 562b23221..3416547da 100644
--- unix/emacs/mozc_emacs_helper.cc
+++ unix/emacs/mozc_emacs_helper.cc
@@ -30,7 +30,6 @@
 #include <cstdio>
 #include <iostream>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/util.h"
@@ -40,9 +39,10 @@
 #include "protocol/commands.pb.h"
 #include "unix/emacs/client_pool.h"
 #include "unix/emacs/mozc_emacs_helper_lib.h"
+#include "absl/flags/flag.h"
 #include "absl/strings/str_format.h"
 
-MOZC_FLAG(bool, suppress_stderr, false, "Discards all the output to stderr.");
+ABSL_FLAG(bool, suppress_stderr, false, "Discards all the output to stderr.");
 
 namespace {
 
@@ -125,7 +125,7 @@ void ProcessLoop() {
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  if (mozc::GetFlag(FLAGS_suppress_stderr)) {
+  if (absl::GetFlag(FLAGS_suppress_stderr)) {
 #ifdef OS_WIN
     const char path[] = "NUL";
 #else
diff --git unix/emacs/mozc_emacs_helper_lib.h unix/emacs/mozc_emacs_helper_lib.h
index 22ecffb08..775e6eb2d 100644
--- unix/emacs/mozc_emacs_helper_lib.h
+++ unix/emacs/mozc_emacs_helper_lib.h
@@ -110,7 +110,7 @@ void ErrorExit(const std::string &error, const std::string &message);
 // Removes unused usage information from output protocol buffers.
 // Usage data may contain line breaks, which have not been supported yet for IPC
 // in S-expression. Only single line S-expressions are supported so far.
-// This function retuns true if usage data is removed.
+// This function returns true if usage data is removed.
 bool RemoveUsageData(mozc::commands::Output *output);
 
 }  // namespace emacs
diff --git unix/ibus/BUILD unix/ibus/BUILD
index ea7d08346..62d6f84c3 100644
--- unix/ibus/BUILD
+++ unix/ibus/BUILD
@@ -229,8 +229,8 @@ cc_binary_mozc(
         ":ibus_mozc_lib",
         ":ibus_mozc_metadata",
         "//base",
-        "//base:flags",
         "//base:init_mozc",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git unix/ibus/key_translator_test.cc unix/ibus/key_translator_test.cc
index a39d51e57..0664abc0b 100644
--- unix/ibus/key_translator_test.cc
+++ unix/ibus/key_translator_test.cc
@@ -216,7 +216,7 @@ TEST_F(KeyTranslatorTest, TranslateSingleModifierMasks) {
   // keyboard are not assigned Shift-0 character. So that, we expect the client
   // send keycode='0'(\x30) with shift modifier, but currently only send
   // keycode='0'. There are few difficulties because the mapping of Shift-0 are
-  // controled xkb in X11, but the way to get the mapping is unclear.
+  // controlled xkb in X11, but the way to get the mapping is unclear.
 
   // ALT modifier
   // M-F1
@@ -507,7 +507,7 @@ TEST_F(KeyTranslatorTest, MultipleShiftKeysTest) {
   IsContained(commands::KeyEvent::SHIFT, out.modifier_keys());
 }
 
-TEST_F(KeyTranslatorTest, TranslateUnknow) {
+TEST_F(KeyTranslatorTest, TranslateUnknown) {
   commands::KeyEvent out;
   EXPECT_FALSE(translator_->Translate(IBUS_VoidSymbol, 0, 0,
                                       config::Config::ROMAN, true, &out));
diff --git unix/ibus/main.cc unix/ibus/main.cc
index b7852cbb4..6813d131a 100644
--- unix/ibus/main.cc
+++ unix/ibus/main.cc
@@ -27,20 +27,21 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#include "unix/ibus/main.h"
+
 #include <cstddef>
 #include <cstdio>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/logging.h"
 #include "base/version.h"
 #include "unix/ibus/ibus_config.h"
-#include "unix/ibus/main.h"
 #include "unix/ibus/mozc_engine.h"
 #include "unix/ibus/path_util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, ibus, false, "The engine is started by ibus-daemon");
-MOZC_FLAG(bool, xml, false, "Output xml data for the engine.");
+ABSL_FLAG(bool, ibus, false, "The engine is started by ibus-daemon");
+ABSL_FLAG(bool, xml, false, "Output xml data for the engine.");
 
 namespace {
 
@@ -119,13 +120,13 @@ void OutputXml() {
 
 int main(gint argc, gchar **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  if (mozc::GetFlag(FLAGS_xml)) {
+  if (absl::GetFlag(FLAGS_xml)) {
     OutputXml();
     return 0;
   }
 
   ibus_init();
-  InitIBusComponent(mozc::GetFlag(FLAGS_ibus));
+  InitIBusComponent(absl::GetFlag(FLAGS_ibus));
 #ifndef MOZC_NO_LOGGING
   EnableVerboseLog();
 #endif  // MOZC_NO_LOGGING
diff --git unix/ibus/main_stub.cc unix/ibus/main_stub.cc
index 48bb490da..29214a801 100644
--- unix/ibus/main_stub.cc
+++ unix/ibus/main_stub.cc
@@ -29,11 +29,11 @@
 
 #include <iostream>
 
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "unix/ibus/ibus_config.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, xml, false, "Output xml data for the engine.");
+ABSL_FLAG(bool, xml, false, "Output xml data for the engine.");
 
 namespace {
 void OutputXml() {
@@ -44,7 +44,7 @@ void OutputXml() {
 
 int main(int argc, char **argv) {
   mozc::InitMozc(argv[0], &argc, &argv);
-  if (mozc::GetFlag(FLAGS_xml)) {
+  if (absl::GetFlag(FLAGS_xml)) {
     OutputXml();
     return 0;
   }
diff --git unix/ibus/mozc_engine.cc unix/ibus/mozc_engine.cc
index be82541b2..8db7fd8c7 100644
--- unix/ibus/mozc_engine.cc
+++ unix/ibus/mozc_engine.cc
@@ -40,7 +40,6 @@
 #include "base/clock.h"
 #include "base/const.h"
 #include "base/file_util.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/singleton.h"
 #include "base/system_util.h"
@@ -58,6 +57,7 @@
 #include "unix/ibus/preedit_handler.h"
 #include "unix/ibus/property_handler.h"
 #include "unix/ibus/surrounding_text_util.h"
+#include "absl/flags/flag.h"
 
 #ifdef ENABLE_GTK_RENDERER
 #include "renderer/renderer_client.h"
@@ -69,7 +69,7 @@
 #endif  // MOZC_ENABLE_X11_SELECTION_MONITOR
 
 #ifdef ENABLE_GTK_RENDERER
-MOZC_FLAG(bool, use_mozc_renderer, true,
+ABSL_FLAG(bool, use_mozc_renderer, true,
           "The engine tries to use mozc_renderer if available.");
 #endif  // ENABLE_GTK_RENDERER
 
@@ -221,7 +221,7 @@ std::unique_ptr<client::ClientInterface> CreateAndConfigureClient() {
 #ifdef ENABLE_GTK_RENDERER
 CandidateWindowHandlerInterface *createGtkCandidateWindowHandler(
     ::mozc::renderer::RendererClient *renderer_client) {
-  if (!mozc::GetFlag(FLAGS_use_mozc_renderer)) {
+  if (!absl::GetFlag(FLAGS_use_mozc_renderer)) {
     return nullptr;
   }
   if (GetEnv("XDG_SESSION_TYPE") == "wayland") {
diff --git usage_stats/BUILD usage_stats/BUILD
index 4f1ce5116..ffc592f0c 100644
--- usage_stats/BUILD
+++ usage_stats/BUILD
@@ -86,7 +86,6 @@ cc_test_mozc(
     deps = [
         ":usage_stats",
         ":usage_stats_proto",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//config:stats_config_util",
@@ -94,6 +93,7 @@ cc_test_mozc(
         "//storage:registry",
         "//storage:storage_interaface",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
@@ -123,12 +123,12 @@ cc_test_mozc(
         ":usage_stats_testing_util",
         ":usage_stats_uploader",
         "//base",
-        "//base:flags",
         "//base:port",
         "//base:system_util",
         "//base:version",
         "//storage:registry",
         "//testing:gunit_main",
+        "@com_google_absl//absl/flags:flag",
     ],
 )
 
diff --git usage_stats/usage_stats.h usage_stats/usage_stats.h
index 8b71d785a..0729d43f2 100644
--- usage_stats/usage_stats.h
+++ usage_stats/usage_stats.h
@@ -80,7 +80,7 @@ class UsageStats {
   // Synchronizes (writes) usage data into disk. Returns false on failure.
   static bool Sync();
 
-  // Clears existing data exept for Integer and Boolean stats.
+  // Clears existing data except for Integer and Boolean stats.
   static void ClearStats();
 
   // Clears all data.
diff --git usage_stats/usage_stats_test.cc usage_stats/usage_stats_test.cc
index 4debfd226..f8d0fea70 100644
--- usage_stats/usage_stats_test.cc
+++ usage_stats/usage_stats_test.cc
@@ -32,7 +32,6 @@
 #include <map>
 #include <string>
 
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "config/stats_config_util.h"
@@ -42,6 +41,7 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "usage_stats/usage_stats.pb.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace usage_stats {
@@ -49,7 +49,7 @@ namespace usage_stats {
 class UsageStatsTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     EXPECT_TRUE(storage::Registry::Clear());
     mozc::config::StatsConfigUtil::SetHandler(&stats_config_util_);
   }
diff --git usage_stats/usage_stats_uploader_test.cc usage_stats/usage_stats_uploader_test.cc
index 9586135c5..fe376c631 100644
--- usage_stats/usage_stats_uploader_test.cc
+++ usage_stats/usage_stats_uploader_test.cc
@@ -35,7 +35,6 @@
 #include <utility>
 #include <vector>
 
-#include "base/flags.h"
 #include "base/port.h"
 #include "base/system_util.h"
 #include "base/version.h"
@@ -43,6 +42,7 @@
 #include "testing/base/public/googletest.h"
 #include "testing/base/public/gunit.h"
 #include "usage_stats/usage_stats.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace usage_stats {
@@ -63,7 +63,7 @@ void SetUpMetaData(uint32 last_upload_time) {
 class UsageStatsUploaderTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     EXPECT_TRUE(storage::Registry::Clear());
   }
 
diff --git win32/base/accessible_object_info.h win32/base/accessible_object_info.h
index ade941773..52e69ff85 100644
--- win32/base/accessible_object_info.h
+++ win32/base/accessible_object_info.h
@@ -40,10 +40,10 @@ namespace win32 {
 struct AccessibleObjectInfo {
   AccessibleObjectInfo();
 
-  string role;  // utf8
+  std::string role;  // utf8
   bool is_builtin_role;
-  string name;   // utf8
-  string value;  // utf8
+  std::string name;   // utf8
+  std::string value;  // utf8
 };
 
 }  // namespace win32
diff --git win32/base/browser_info.cc win32/base/browser_info.cc
index 1bccec4e2..4fb1bb0bf 100644
--- win32/base/browser_info.cc
+++ win32/base/browser_info.cc
@@ -113,26 +113,26 @@ bool BrowserInfo::IsInIncognitoMode(
     return false;
   }
 
-  const char *sufix_ja = nullptr;
-  const char *sufix_en = nullptr;
+  const char *suffix_ja = nullptr;
+  const char *suffix_en = nullptr;
   switch (GetBrowerType()) {
     case kBrowserTypeChrome:
-      sufix_ja = "(シークレット モード)";
-      sufix_en = "(Incognito)";
+      suffix_ja = "(シークレット モード)";
+      suffix_en = "(Incognito)";
       break;
     case kBrowserTypeFirefox:
-      sufix_ja = " (プライベートブラウジング)";
-      sufix_en = "(Private Browsing)";
+      suffix_ja = " (プライベートブラウジング)";
+      suffix_en = "(Private Browsing)";
       break;
     case kBrowserTypeIE:
-      sufix_ja = "[InPrivate]";
-      sufix_en = "[InPrivate]";
+      suffix_ja = "[InPrivate]";
+      suffix_en = "[InPrivate]";
       break;
   }
-  if (sufix_ja != nullptr && Util::EndsWith(root_window_name, sufix_ja)) {
+  if (suffix_ja != nullptr && Util::EndsWith(root_window_name, suffix_ja)) {
     return true;
   }
-  if (sufix_en != nullptr && Util::EndsWith(root_window_name, sufix_en)) {
+  if (suffix_en != nullptr && Util::EndsWith(root_window_name, suffix_en)) {
     return true;
   }
   return false;
diff --git win32/base/focus_hierarchy_observer.h win32/base/focus_hierarchy_observer.h
index faa5173a0..beb3e438c 100644
--- win32/base/focus_hierarchy_observer.h
+++ win32/base/focus_hierarchy_observer.h
@@ -46,8 +46,8 @@ class FocusHierarchyObserver {
   struct WindowInfo {
     WindowInfo();
     HWND window_handle;
-    string title;       // utf8
-    string class_name;  // utf8
+    std::string title;       // utf8
+    std::string class_name;  // utf8
     DWORD process_id;
   };
 
@@ -57,7 +57,7 @@ class FocusHierarchyObserver {
   virtual bool IsAbailable() const = 0;
   virtual std::vector<AccessibleObjectInfo> GetUIHierarchy() const = 0;
   virtual std::vector<WindowInfo> GetWindowHierarchy() const = 0;
-  virtual string GetRootWindowName() const = 0;
+  virtual std::string GetRootWindowName() const = 0;
 
   static FocusHierarchyObserver *Create();
   static void OnDllProcessAttach(HINSTANCE module_handle, bool static_loading);
diff --git win32/base/input_dll.h win32/base/input_dll.h
index 4cbaf28e4..4c7204bed 100644
--- win32/base/input_dll.h
+++ win32/base/input_dll.h
@@ -32,7 +32,7 @@
 
 #include <windows.h>
 
-// Structures and flags bellow have not been included header files in Windows
+// Structures and flags below have not been included header files in Windows
 // SDK.  You can see the original source of this information at the following
 // page.
 // - http://msdn.microsoft.com/en-us/library/bb847907.aspx
@@ -183,7 +183,7 @@ extern "C" __declspec(dllimport) BOOL WINAPI
 //     FALSE: An unspecified error occurred.
 //   Observational Facts:
 //     This API seems to be designed to modify per user settings, like HKCU,
-//     so that the current user can modify it with his/her privileges.  In
+//     so that the current user can modify it with their privileges.  In
 //     oother words, no administrative privilege is required.
 //     SetDefaultLayoutOrTipUserReg might be a phantom, which only exists in
 //     MSDN Library.
diff --git win32/base/keyevent_handler.cc win32/base/keyevent_handler.cc
index a627b386f..8913706a9 100644
--- win32/base/keyevent_handler.cc
+++ win32/base/keyevent_handler.cc
@@ -521,7 +521,7 @@ bool ConvertToKeyEventMain(const VirtualKey &virtual_key, BYTE scan_code,
   //    VK_A         -> 'a'
   //    VK_A + SHIFT -> '('
   // Unfortunately, the current Mozc protocol cannot handle these cases because
-  // there is serious ambiguity betwen 'Key' and 'Character' in Mozc key
+  // there is serious ambiguity between 'Key' and 'Character' in Mozc key
   // bindings.
   const bool is_vk_alpha =
       ('A' <= virtual_key.virtual_key() && virtual_key.virtual_key() <= 'Z');
@@ -924,7 +924,7 @@ bool KeyEventHandler::ConvertToKeyEvent(
     const InputState &ime_state, const KeyboardStatus &keyboard_status,
     Win32KeyboardInterface *keyboard, mozc::commands::KeyEvent *key) {
   // Since Mozc protocol requires tricky conditions for modifiers, using set
-  // container makes the the main part of key event conversion simple rather
+  // container makes the main part of key event conversion simple rather
   // than using vector-like container.
   std::set<KeyEvent::ModifierKey> modifiers;
   const bool result = ConvertToKeyEventMain(
diff --git win32/base/keyevent_handler_test.cc win32/base/keyevent_handler_test.cc
index e3e326522..86d779c59 100644
--- win32/base/keyevent_handler_test.cc
+++ win32/base/keyevent_handler_test.cc
@@ -27,6 +27,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#include "win32/base/keyevent_handler.h"
+
 // clang-format off
 #include <windows.h>
 #include <ime.h>
@@ -36,7 +38,6 @@
 #include <memory>
 #include <string>
 
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/system_util.h"
 #include "base/version.h"
@@ -48,7 +49,7 @@
 #include "testing/base/public/gunit.h"
 #include "win32/base/input_state.h"
 #include "win32/base/keyboard.h"
-#include "win32/base/keyevent_handler.h"
+#include "absl/flags/flag.h"
 
 namespace mozc {
 namespace win32 {
@@ -245,7 +246,7 @@ class KeyEventHandlerTest : public testing::Test {
   KeyEventHandlerTest() {}
   virtual ~KeyEventHandlerTest() {}
   virtual void SetUp() {
-    SystemUtil::SetUserProfileDirectory(mozc::GetFlag(FLAGS_test_tmpdir));
+    SystemUtil::SetUserProfileDirectory(absl::GetFlag(FLAGS_test_tmpdir));
     mozc::config::ConfigHandler::GetDefaultConfig(&default_config_);
     mozc::config::ConfigHandler::SetConfig(default_config_);
   }
diff --git win32/base/string_util.h win32/base/string_util.h
index cbedd8c50..49d640e4f 100644
--- win32/base/string_util.h
+++ win32/base/string_util.h
@@ -58,7 +58,7 @@ class StringUtil {
 
   // Returns a UTF8 string converted from the result of KeyToReading.
   // This function is mainly for unittest.
-  static string KeyToReadingA(absl::string_view key);
+  static std::string KeyToReadingA(absl::string_view key);
 
   // Joins all segment strings in |preedit| and returns it.
   static std::wstring ComposePreeditText(
diff --git win32/base/surrogate_pair_observer.h win32/base/surrogate_pair_observer.h
index 911071cc3..702e4932e 100644
--- win32/base/surrogate_pair_observer.h
+++ win32/base/surrogate_pair_observer.h
@@ -44,7 +44,7 @@ class SurrogatePairObserver {
   // Return code which represents the expected action of the IME DLL.
   enum ClientActionType {
     // This key event is not a VK_PACKET-related event.
-    // The the caller must do the default action.
+    // The caller must do the default action.
     DO_DEFAULT_ACTION = 0,
     // This key event is a VK_PACKET-related event.
     // The caller replace the VirtualKey instance with new one which conatins
diff --git win32/base/uninstall_helper.h win32/base/uninstall_helper.h
index dda9d7960..3d9ac63e0 100644
--- win32/base/uninstall_helper.h
+++ win32/base/uninstall_helper.h
@@ -79,7 +79,7 @@ class UninstallHelper {
   // settings.  Please beware that this method touches HKCU hive especially
   // when you call this method from a custom action.  If you call this
   // function from the deferred custom action which does not use
-  // impersonation, it is highly recomended to set true for
+  // impersonation, it is highly recommended to set true for
   // |disable_hkcu_cache| so that HKCU points HKU/.Default as expected.
   static bool EnsureIMEIsRemovedForCurrentUser(bool disable_hkcu_cache);
 
diff --git win32/broker/ime_switcher.cc win32/broker/ime_switcher.cc
index 40d4abea4..e8a6218ff 100644
--- win32/broker/ime_switcher.cc
+++ win32/broker/ime_switcher.cc
@@ -33,7 +33,6 @@
 #include <vector>
 
 #include "base/const.h"
-#include "base/flags.h"
 #include "base/logging.h"
 #include "base/process_mutex.h"
 #include "base/scoped_handle.h"
@@ -45,8 +44,9 @@
 #include "win32/base/imm_registrar.h"
 #include "win32/base/imm_util.h"
 #include "win32/base/migration_util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(bool, set_default_do_not_ask_again, false,
+ABSL_FLAG(bool, set_default_do_not_ask_again, false,
           "Set true if SetDefaultDialog should not be displayed again.");
 
 namespace mozc {
@@ -144,7 +144,7 @@ int RunSetDefaultWin8() {
     return kErrorLevelGeneralError;
   }
 
-  if (mozc::GetFlag(FLAGS_set_default_do_not_ask_again)) {
+  if (absl::GetFlag(FLAGS_set_default_do_not_ask_again)) {
     if (!ClearCheckDefault()) {
       // Notify the error to user but never treat this as an error.
       NotifyFatalMessage("ClearCheckDefault() failed.", __LINE__);
@@ -183,7 +183,7 @@ int RunSetDefault(int argc, char *argv[]) {
     return kErrorLevelGeneralError;
   }
 
-  if (mozc::GetFlag(FLAGS_set_default_do_not_ask_again)) {
+  if (absl::GetFlag(FLAGS_set_default_do_not_ask_again)) {
     if (!ClearCheckDefault()) {
       // Notify the error to user but never treat this as an error.
       NotifyFatalMessage("ClearCheckDefault() failed.", __LINE__);
diff --git win32/broker/mozc_broker.rc win32/broker/mozc_broker.rc
index 7f625b4e1..8448fbe59 100644
Binary files win32/broker/mozc_broker.rc and win32/broker/mozc_broker.rc differ
diff --git win32/broker/mozc_broker_main.cc win32/broker/mozc_broker_main.cc
index 954c30042..6abd2343d 100644
--- win32/broker/mozc_broker_main.cc
+++ win32/broker/mozc_broker_main.cc
@@ -32,15 +32,15 @@
 #endif  // OS_WIN
 
 #include "base/crash_report_handler.h"
-#include "base/flags.h"
 #include "base/init_mozc.h"
 #include "base/system_util.h"
 #ifdef OS_WIN
 #include "base/winmain.h"
 #endif  // OS_WIN
 #include "config/stats_config_util.h"
+#include "absl/flags/flag.h"
 
-MOZC_FLAG(string, mode, "", "mozc_broker mode");
+ABSL_FLAG(std::string, mode, "", "mozc_broker mode");
 
 #ifdef OS_WIN
 namespace mozc {
@@ -66,13 +66,13 @@ int main(int argc, char *argv[]) {
 
   int result = 0;
 #ifdef OS_WIN
-  if (mozc::GetFlag(FLAGS_mode) == "register_ime") {
+  if (absl::GetFlag(FLAGS_mode) == "register_ime") {
     result = mozc::win32::RunRegisterIME(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "set_default") {
+  } else if (absl::GetFlag(FLAGS_mode) == "set_default") {
     result = mozc::win32::RunSetDefault(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "unregister_ime") {
+  } else if (absl::GetFlag(FLAGS_mode) == "unregister_ime") {
     result = mozc::win32::RunUnregisterIME(argc, argv);
-  } else if (mozc::GetFlag(FLAGS_mode) == "prelaunch_processes") {
+  } else if (absl::GetFlag(FLAGS_mode) == "prelaunch_processes") {
     result = mozc::win32::RunPrelaunchProcesses(argc, argv);
   }
 #endif  // OS_WIN
diff --git win32/custom_action/custom_action.h win32/custom_action/custom_action.h
index b4f461d4f..8633c32d6 100644
--- win32/custom_action/custom_action.h
+++ win32/custom_action/custom_action.h
@@ -96,7 +96,7 @@ UINT __stdcall InitialInstallationCommit(MSIHANDLE msi_handle);
 // RestoreServiceState.
 // Since they are executed as deferred customs actions and most properties
 // cannot be accessible from a deferred custom action, it is necessary to store
-// these data explictly to CustomCationData.
+// these data explicitly to CustomCationData.
 UINT __stdcall SaveCustomActionData(MSIHANDLE msi_handle);
 
 // Restore the settings of the cache service as it was.
diff --git win32/custom_action/custom_action.rc win32/custom_action/custom_action.rc
index a395f6ee2..5f818c8ce 100644
Binary files win32/custom_action/custom_action.rc and win32/custom_action/custom_action.rc differ
diff --git win32/ime/GoogleIMEJa.rc win32/ime/GoogleIMEJa.rc
index fac32bb7c..5cd73c21f 100644
Binary files win32/ime/GoogleIMEJa.rc and win32/ime/GoogleIMEJa.rc differ
diff --git win32/ime/ime_candidate_info_test.cc win32/ime/ime_candidate_info_test.cc
index 32a2d73f1..2b5c11495 100644
--- win32/ime/ime_candidate_info_test.cc
+++ win32/ime/ime_candidate_info_test.cc
@@ -104,11 +104,11 @@ const int32 kIDs[kNumCandidates] = {
     0, 1, 2, 3, 4, 5, 6, 7, -1, -2, -3, -7, -11,
 };
 
-class ScopedCanidateInfoBuffer {
+class ScopedCandidateInfoBuffer {
  public:
-  explicit ScopedCanidateInfoBuffer(size_t size)
+  explicit ScopedCandidateInfoBuffer(size_t size)
       : header_(static_cast<CANDIDATEINFO *>(Allocate(size))) {}
-  ~ScopedCanidateInfoBuffer() { ::HeapFree(::GetProcessHeap(), 0, header_); }
+  ~ScopedCandidateInfoBuffer() { ::HeapFree(::GetProcessHeap(), 0, header_); }
   const CANDIDATEINFO *header() const { return header_; }
   CANDIDATEINFO *mutable_header() { return header_; }
   const CANDIDATELIST *GetList(int candidate_list_no) const {
@@ -133,7 +133,7 @@ class ScopedCanidateInfoBuffer {
   }
   CANDIDATEINFO *header_;
 
-  DISALLOW_COPY_AND_ASSIGN(ScopedCanidateInfoBuffer);
+  DISALLOW_COPY_AND_ASSIGN(ScopedCandidateInfoBuffer);
 };
 
 // TODO(yukawa): Make a common library for this function.
@@ -529,7 +529,7 @@ TEST(CandidateInfoUtilTest, WriteResultTest) {
   CandidateInfo info;
   EXPECT_TRUE(CandidateInfoUtil::Convert(output, &info));
 
-  ScopedCanidateInfoBuffer buffer(info.candidate_info_size);
+  ScopedCandidateInfoBuffer buffer(info.candidate_info_size);
   CandidateInfoUtil::Write(info, buffer.mutable_header());
 
   EXPECT_CANDIDATEINFO(330, 1, sizeof(CANDIDATEINFO), 0, 0, buffer.header());
@@ -558,7 +558,7 @@ TEST(CandidateInfoUtilTest, PagingEmulation_Issue4077022) {
   CandidateInfo info;
   EXPECT_TRUE(CandidateInfoUtil::Convert(output, &info));
 
-  ScopedCanidateInfoBuffer buffer(info.candidate_info_size);
+  ScopedCandidateInfoBuffer buffer(info.candidate_info_size);
   CandidateInfoUtil::Write(info, buffer.mutable_header());
 
   EXPECT_CANDIDATEINFO(330, 1, sizeof(CANDIDATEINFO), 0, 0, buffer.header());
@@ -573,7 +573,7 @@ TEST(CandidateInfoUtilTest, WriteSafeDefaultTest) {
   CandidateInfo info;
   CandidateInfoUtil::SetSafeDefault(&info);
 
-  ScopedCanidateInfoBuffer buffer(info.candidate_info_size);
+  ScopedCandidateInfoBuffer buffer(info.candidate_info_size);
   CandidateInfoUtil::Write(info, buffer.mutable_header());
 
   EXPECT_CANDIDATEINFO(sizeof(CANDIDATEINFO) + sizeof(CANDIDATELIST), 1,
diff --git win32/ime/ime_composition_string.cc win32/ime/ime_composition_string.cc
index ed1a22fc7..0bdcf5c9c 100644
--- win32/ime/ime_composition_string.cc
+++ win32/ime/ime_composition_string.cc
@@ -116,7 +116,7 @@ bool CompositionString::Update(const mozc::commands::Output &output,
     // In OOo, we need this message to restore caret status.
     // We should not send this null-WM_IME_COMPOSITION when
     // |info.dwResultStrLen != 0|.  Otherwise, the result string will be
-    // commited twice in wordpad.exe.
+    // committed twice in wordpad.exe.
     if (info.dwResultStrLen == 0) {
       messages->push_back(UIMessage(WM_IME_COMPOSITION, 0, 0));
     }
diff --git win32/ime/ime_composition_string.h win32/ime/ime_composition_string.h
index 746eca7a2..50daeec00 100644
--- win32/ime/ime_composition_string.h
+++ win32/ime/ime_composition_string.h
@@ -99,9 +99,9 @@ struct CompositionString {
   FRIEND_TEST(ImeCompositionStringTest,
               EndCompositionWhenCompositionBecomesEmpty);
   FRIEND_TEST(ImeCompositionStringTest,
-              EndCompositionWhenCompositionIsCommited);
+              EndCompositionWhenCompositionIsCommitted);
   FRIEND_TEST(ImeCompositionStringTest,
-              EndCompositionWhenCompositionIsCommitedWithPreedit);
+              EndCompositionWhenCompositionIsCommittedWithPreedit);
   FRIEND_TEST(ImeCompositionStringTest, SpaceKeyWhenIMEIsTurnedOn_Issue3200585);
   FRIEND_TEST(ImeCompositionStringTest, Suggest);
   FRIEND_TEST(ImeCompositionStringTest, Predict);
diff --git win32/ime/ime_composition_string_test.cc win32/ime/ime_composition_string_test.cc
index 68762a37a..0d3cf4e16 100644
--- win32/ime/ime_composition_string_test.cc
+++ win32/ime/ime_composition_string_test.cc
@@ -555,9 +555,9 @@ TEST(ImeCompositionStringTest, EndCompositionWhenCompositionBecomesEmpty) {
   EXPECT_EQ(0, compstr.info.dwResultStrLen);
 }
 
-TEST(ImeCompositionStringTest, EndCompositionWhenCompositionIsCommited) {
+TEST(ImeCompositionStringTest, EndCompositionWhenCompositionIsCommitted) {
   // WM_IME_COMPOSITION should be sent up to once.
-  // Otherwise, the result string will be commited twice in wordpad.exe.
+  // Otherwise, the result string will be committed twice in wordpad.exe.
 
   CompositionString compstr;
   EXPECT_TRUE(compstr.Initialize());
@@ -666,9 +666,9 @@ TEST(ImeCompositionStringTest, SpaceKeyWhenIMEIsTurnedOn_Issue3200585) {
 }
 
 TEST(ImeCompositionStringTest,
-     EndCompositionWhenCompositionIsCommitedWithPreedit) {
+     EndCompositionWhenCompositionIsCommittedWithPreedit) {
   // WM_IME_COMPOSITION should be sent up to once.
-  // Otherwise, the result string will be commited twice in wordpad.exe.
+  // Otherwise, the result string will be committed twice in wordpad.exe.
 
   CompositionString compstr;
   EXPECT_TRUE(compstr.Initialize());
diff --git win32/ime/ime_core.cc win32/ime/ime_core.cc
index e16785268..4cd9cb8c5 100644
--- win32/ime/ime_core.cc
+++ win32/ime/ime_core.cc
@@ -626,7 +626,7 @@ bool ImeCore::UpdateContextMain(HIMC himc, const InputState &next_state,
 
   if (generate_message) {
     // In order to minimize the risk of application compatibility problem,
-    // we might want to send these messages in the the same order to MS-IME.
+    // we might want to send these messages in the same order to MS-IME.
     // See b/3488848 for details.
     std::vector<UIMessage> sorted_messages;
     SortIMEMessages(composition_messages, candidate_messages, previous_open,
diff --git win32/ime/ime_core.h win32/ime/ime_core.h
index 6c998ada7..7be02c79f 100644
--- win32/ime/ime_core.h
+++ win32/ime/ime_core.h
@@ -217,7 +217,7 @@ class ImeCore {
 
   // Returns the target string in UTF8 for the reconversion invoked by IME.
   // Returns an empty string if the target strin is not available.
-  static string GetTextForReconversionFromIME(HIMC himc);
+  static std::string GetTextForReconversionFromIME(HIMC himc);
 
   FRIEND_TEST(ImeCoreTest, TemporalConversionModeMessageOrderTest);
   FRIEND_TEST(ImeCoreTest, CandidateMessageOrderTest);
diff --git win32/ime/ime_language_bar.cc win32/ime/ime_language_bar.cc
index 8a4ca264d..ba5334cbe 100644
--- win32/ime/ime_language_bar.cc
+++ win32/ime/ime_language_bar.cc
@@ -47,7 +47,7 @@ using ATL::CComQIPtr;
 namespace {
 // The GUID of the help menu in the system language bar.
 // TODO(mazda): Confirm this GUID is valid permanently for the system help menu
-// since the GUID was programatically obtained.
+// since the GUID was programmatically obtained.
 // It is confirmed that the GUID is valid on Windows XP SP2 and Windows Vista.
 // {ED9D5450-EBE6-4255-8289-F8A31E687228}
 const GUID kSystemLangBarHelpMenu = {
diff --git win32/ime/ime_language_bar_menu.cc win32/ime/ime_language_bar_menu.cc
index ee1c3ad02..7e2ad5c23 100644
--- win32/ime/ime_language_bar_menu.cc
+++ win32/ime/ime_language_bar_menu.cc
@@ -139,9 +139,9 @@ HICON LoadIconFromResource(HINSTANCE instance, UINT icon_id_for_non_theme,
 
 // Retrieves the bitmap handle loaded by using an icon ID.
 // Returns true if the specified icons is available as bitmaps.
-// Caller can set nullptr for |color| and/or |mask| to represent not to recieve
+// Caller can set nullptr for |color| and/or |mask| to represent not to receive
 // the specified handle even if it exists.  Caller should releases any returned
-// bitmap handle and this function releases any handle which is not recieved
+// bitmap handle and this function releases any handle which is not received
 // by the caller.
 bool LoadIconAsBitmap(HINSTANCE instance, UINT icon_id_for_non_theme,
                       UINT icon_id_for_theme, HBITMAP* color, HBITMAP* mask) {
@@ -260,7 +260,7 @@ STDAPI ImeLangBarMenu::GetInfo(TF_LANGBARITEMINFO* item_info) {
 }
 
 // Implements the ITfLangBarItem::GetStatus() function.
-// This fucntion is called by Windows to retrieve the current status of this
+// This function is called by Windows to retrieve the current status of this
 // button menu.
 STDAPI ImeLangBarMenu::GetStatus(DWORD* status) {
   *status = status_;
@@ -271,7 +271,7 @@ STDAPI ImeLangBarMenu::GetStatus(DWORD* status) {
 // This function is called by Windows to notify the display status of this
 // button menu has been updated.
 STDAPI ImeLangBarMenu::Show(BOOL show) {
-  // Just return becasue this button is always shown, i.e. we do not have to
+  // Just return because this button is always shown, i.e. we do not have to
   // manage the display state of this button menu.
   return E_NOTIMPL;
 }
@@ -295,14 +295,14 @@ STDAPI ImeLangBarMenu::OnClick(TfLBIClick click, POINT point,
 }
 
 // Implements the ITfLangBarItemButton::GetText() function.
-// This function is called by Windows to retrive the text label of this
+// This function is called by Windows to retrieve the text label of this
 // button menu.
 STDAPI ImeLangBarMenu::GetText(BSTR* text) {
   *text = ::SysAllocString(&item_info_.szDescription[0]);
   return (*text ? S_OK : E_OUTOFMEMORY);
 }
 
-// Implements the ITfSource::AdviseSink() funtion.
+// Implements the ITfSource::AdviseSink() function.
 STDAPI ImeLangBarMenu::AdviseSink(REFIID interface_id, IUnknown* unknown,
                                   DWORD* cookie) {
   // Return if the caller tries to start advising any events except the
diff --git win32/ime/ime_ui_visibility_tracker_test.cc win32/ime/ime_ui_visibility_tracker_test.cc
index 7be77ae70..08be7fd0e 100644
--- win32/ime/ime_ui_visibility_tracker_test.cc
+++ win32/ime/ime_ui_visibility_tracker_test.cc
@@ -124,7 +124,7 @@ TEST(ImeUIVisibilityTrackerTest,
 }
 
 // When a user changes the input method by the LangBar, WM_IME_SETCONTEXT will
-// not be sent.  Even in this case, the candiate window can be visible,
+// not be sent.  Even in this case, the candidate window can be visible,
 // without any focus change, which finally invokes ImeSetActiveContext.
 TEST(ImeUIVisibilityTrackerTest,
      CandidateWindowCanBeShownWhenImeIsChangedByLangBar) {
diff --git win32/ime/ime_ui_window.cc win32/ime/ime_ui_window.cc
index b4506aa27..ba37b8e7e 100644
--- win32/ime/ime_ui_window.cc
+++ win32/ime/ime_ui_window.cc
@@ -82,7 +82,7 @@ using WTL::CRect;
 using ::mozc::renderer::win32::Win32RendererClient;
 using ::std::unique_ptr;
 
-// True if the the DLL received DLL_PROCESS_DETACH notification.
+// True if the DLL received DLL_PROCESS_DETACH notification.
 volatile bool g_module_unloaded = false;
 
 // As filed in b/3088049 or b/4271156, the IME module (e.g. GIMEJa.ime) is
@@ -979,7 +979,7 @@ class DefaultUIWindow {
 //   [N] kMessageReceiverMessageName / SELECT_CANDIDATE
 //                      any other message(s)
 //
-//   In this case, messages from [1] to [3] can be removed and and start
+//   In this case, messages from [1] to [3] can be removed and start
 //   handling the message [4] as if it the handler just received it.
 //
 //
@@ -992,7 +992,7 @@ class DefaultUIWindow {
 //   [N] kMessageReceiverMessageName / HIGHLIGHT_CANDIDATE
 //                      any other message(s)
 //
-//   In this case, messages from [1] to [2] can be removed and and start
+//   In this case, messages from [1] to [2] can be removed and start
 //   handling the message [4] as if it the handler just received it.
 //
 //
diff --git win32/tip/tip_candidate_list_test.cc win32/tip/tip_candidate_list_test.cc
index 689a502b7..2cd3c60ed 100644
--- win32/tip/tip_candidate_list_test.cc
+++ win32/tip/tip_candidate_list_test.cc
@@ -108,14 +108,14 @@ std::wstring ToWStr(const CComBSTR &bstr) {
 
 AssertionResult ExpectCandidateString(ULONG expected_index,
                                       const std::wstring &expected_text,
-                                      CComPtr<ITfCandidateString> candiate) {
-  if (candiate == nullptr) {
+                                      CComPtr<ITfCandidateString> candidate) {
+  if (candidate == nullptr) {
     return AssertionFailure() << "|actual| should be non-null";
   }
   HRESULT hr = S_OK;
   {
     ULONG index = 0;
-    hr = candiate->GetIndex(&index);
+    hr = candidate->GetIndex(&index);
     if (FAILED(hr)) {
       return AssertionFailure() << "ITfCandidateString::GetIndex failed."
                                 << " hr = " << hr;
@@ -127,7 +127,7 @@ AssertionResult ExpectCandidateString(ULONG expected_index,
   }
   {
     CComBSTR str;
-    hr = candiate->GetString(&str);
+    hr = candidate->GetString(&str);
     if (FAILED(hr)) {
       return AssertionFailure() << "ITfCandidateString::GetString failed."
                                 << " hr = " << hr;
@@ -144,7 +144,7 @@ AssertionResult ExpectCandidateString(ULONG expected_index,
 #define EXPECT_CANDIDATE_STR(expected_index, expected_str, actual) \
   EXPECT_PRED3(ExpectCandidateString, expected_index, expected_str, actual)
 
-TEST(TipCandidateListTest, EmptyCandiate) {
+TEST(TipCandidateListTest, EmptyCandidate) {
   MockCallbackResult result;
 
   std::vector<std::wstring> empty;
@@ -177,7 +177,7 @@ TEST(TipCandidateListTest, EmptyCandiate) {
   EXPECT_FALSE(result.on_finalize_called());
 }
 
-TEST(TipCandidateListTest, NonEmptyCandiates) {
+TEST(TipCandidateListTest, NonEmptyCandidates) {
   MockCallbackResult result;
 
   std::vector<std::wstring> source;
diff --git win32/tip/tip_edit_session_impl.cc win32/tip/tip_edit_session_impl.cc
index 6ad73ed71..e8fcee526 100644
--- win32/tip/tip_edit_session_impl.cc
+++ win32/tip/tip_edit_session_impl.cc
@@ -154,7 +154,7 @@ CComPtr<ITfComposition> CreateComposition(TipTextService *text_service,
 //      interpreted as the "committed text".
 //   4. Update the caret position explicitly. Note that some applications
 //      such as WPF's TextBox do not update the caret position automatically
-//      when an composition is commited.
+//      when an composition is committed.
 // See also b/8406545 and b/9747361.
 CComPtr<ITfComposition> CommitText(TipTextService *text_service,
                                    ITfContext *context,
diff --git win32/tip/tip_lang_bar_menu.cc win32/tip/tip_lang_bar_menu.cc
index 0edc32198..2c715660f 100644
--- win32/tip/tip_lang_bar_menu.cc
+++ win32/tip/tip_lang_bar_menu.cc
@@ -138,9 +138,9 @@ HICON LoadIconFromResource(HINSTANCE instance, UINT icon_id_for_non_theme,
 
 // Retrieves the bitmap handle loaded by using an icon ID.
 // Returns true if the specified icons is available as bitmaps.
-// Caller can set nullptr for |color| and/or |mask| to represent not to recieve
+// Caller can set nullptr for |color| and/or |mask| to represent not to receive
 // the specified handle even if it exists.  Caller should releases any returned
-// bitmap handle and this function releases any handle which is not recieved
+// bitmap handle and this function releases any handle which is not received
 // by the caller.
 bool LoadIconAsBitmap(HINSTANCE instance, UINT icon_id_for_non_theme,
                       UINT icon_id_for_theme, HBITMAP *color, HBITMAP *mask) {
@@ -267,7 +267,7 @@ STDMETHODIMP TipLangBarButton::GetInfo(TF_LANGBARITEMINFO *item_info) {
 }
 
 // Implements the ITfLangBarItem::GetStatus() function.
-// This fucntion is called by Windows to retrieve the current status of this
+// This function is called by Windows to retrieve the current status of this
 // button menu.
 STDMETHODIMP TipLangBarButton::GetStatus(DWORD *status) {
   *status = status_;
@@ -278,7 +278,7 @@ STDMETHODIMP TipLangBarButton::GetStatus(DWORD *status) {
 // This function is called by Windows to notify the display status of this
 // button menu has been updated.
 STDMETHODIMP TipLangBarButton::Show(BOOL show) {
-  // Just return becasue this button is always shown, i.e. we do not have to
+  // Just return because this button is always shown, i.e. we do not have to
   // manage the display state of this button menu.
   return E_NOTIMPL;
 }
@@ -371,14 +371,14 @@ STDMETHODIMP TipLangBarButton::OnClick(TfLBIClick click, POINT point,
 }
 
 // Implements the ITfLangBarItemButton::GetText() function.
-// This function is called by Windows to retrive the text label of this
+// This function is called by Windows to retrieve the text label of this
 // button menu.
 STDMETHODIMP TipLangBarButton::GetText(BSTR *text) {
   *text = ::SysAllocString(&item_info_.szDescription[0]);
   return (*text ? S_OK : E_OUTOFMEMORY);
 }
 
-// Implements the ITfSource::AdviseSink() funtion.
+// Implements the ITfSource::AdviseSink() function.
 STDMETHODIMP TipLangBarButton::AdviseSink(REFIID interface_id,
                                           IUnknown *unknown, DWORD *cookie) {
   // Return if the caller tries to start advising any events except the
diff --git win32/tip/tip_reconvert_function.cc win32/tip/tip_reconvert_function.cc
index 77d408a9c..6f0231153 100644
--- win32/tip/tip_reconvert_function.cc
+++ win32/tip/tip_reconvert_function.cc
@@ -134,7 +134,7 @@ class ReconvertFunctionImpl : public ITfFnReconversion {
   // The ITfFnReconversion interface method.
   virtual HRESULT STDMETHODCALLTYPE QueryRange(ITfRange *range,
                                                ITfRange **new_range,
-                                               BOOL *convertable) {
+                                               BOOL *convertible) {
     if (range == nullptr) {
       return E_INVALIDARG;
     }
@@ -142,10 +142,10 @@ class ReconvertFunctionImpl : public ITfFnReconversion {
       return E_INVALIDARG;
     }
     BOOL dummy_bool = FALSE;
-    if (convertable == nullptr) {
-      convertable = &dummy_bool;
+    if (convertible == nullptr) {
+      convertible = &dummy_bool;
     }
-    *convertable = FALSE;
+    *convertible = FALSE;
     *new_range = nullptr;
 
     CComPtr<ITfContext> context;
@@ -160,7 +160,7 @@ class ReconvertFunctionImpl : public ITfFnReconversion {
 
     if (info.in_composition) {
       // on-going composition is found.
-      *convertable = FALSE;
+      *convertible = FALSE;
       *new_range = nullptr;
       return S_OK;
     }
@@ -168,7 +168,7 @@ class ReconvertFunctionImpl : public ITfFnReconversion {
     if (info.selected_text.find(static_cast<wchar_t>(TS_CHAR_EMBEDDED)) !=
         std::wstring::npos) {
       // embedded object is found.
-      *convertable = FALSE;
+      *convertible = FALSE;
       *new_range = nullptr;
       return S_OK;
     }
@@ -176,7 +176,7 @@ class ReconvertFunctionImpl : public ITfFnReconversion {
     if (FAILED(range->Clone(new_range))) {
       return E_FAIL;
     }
-    *convertable = TRUE;
+    *convertible = TRUE;
     return S_OK;
   }
 
diff --git win32/tip/tip_resource.rc win32/tip/tip_resource.rc
index d9b24ea7e..640277e0d 100644
Binary files win32/tip/tip_resource.rc and win32/tip/tip_resource.rc differ
diff --git win32/tip/tip_surrounding_text.cc win32/tip/tip_surrounding_text.cc
index d42c065c0..ed5f9235d 100644
--- win32/tip/tip_surrounding_text.cc
+++ win32/tip/tip_surrounding_text.cc
@@ -148,14 +148,14 @@ class SurroudingTextUpdater : public ITfEditSession {
     const TF_HALTCOND halt_cond = {nullptr, TF_ANCHOR_START, TF_HF_OBJECT};
 
     {
-      CComPtr<ITfRange> preceeding_range;
-      LONG preceeding_range_shifted = 0;
-      if (SUCCEEDED(selected_range->Clone(&preceeding_range)) &&
-          SUCCEEDED(preceeding_range->Collapse(edit_cookie, TF_ANCHOR_START)) &&
-          SUCCEEDED(preceeding_range->ShiftStart(
-              edit_cookie, -kMaxSurroundingLength, &preceeding_range_shifted,
+      CComPtr<ITfRange> preceding_range;
+      LONG preceding_range_shifted = 0;
+      if (SUCCEEDED(selected_range->Clone(&preceding_range)) &&
+          SUCCEEDED(preceding_range->Collapse(edit_cookie, TF_ANCHOR_START)) &&
+          SUCCEEDED(preceding_range->ShiftStart(
+              edit_cookie, -kMaxSurroundingLength, &preceding_range_shifted,
               &halt_cond))) {
-        result = TipRangeUtil::GetText(preceeding_range, edit_cookie,
+        result = TipRangeUtil::GetText(preceding_range, edit_cookie,
                                        &result_.preceding_text);
         result_.has_preceding_text = SUCCEEDED(result);
       }
@@ -241,11 +241,11 @@ class PrecedingTextDeleter : public ITfEditSession {
 
     const TF_HALTCOND halt_cond = {nullptr, TF_ANCHOR_START, 0};
 
-    CComPtr<ITfRange> preceeding_range;
-    if (FAILED(selected_range->Clone(&preceeding_range))) {
+    CComPtr<ITfRange> preceding_range;
+    if (FAILED(selected_range->Clone(&preceding_range))) {
       return E_FAIL;
     }
-    if (FAILED(preceeding_range->Collapse(edit_cookie, TF_ANCHOR_START))) {
+    if (FAILED(preceding_range->Collapse(edit_cookie, TF_ANCHOR_START))) {
       return E_FAIL;
     }
 
@@ -256,14 +256,14 @@ class PrecedingTextDeleter : public ITfEditSession {
     }
     const LONG initial_offset_utf16 =
         -static_cast<LONG>(num_characters_in_ucs4_) * 2;
-    LONG preceeding_range_shifted = 0;
-    if (FAILED(preceeding_range->ShiftStart(edit_cookie, initial_offset_utf16,
-                                            &preceeding_range_shifted,
+    LONG preceding_range_shifted = 0;
+    if (FAILED(preceding_range->ShiftStart(edit_cookie, initial_offset_utf16,
+                                            &preceding_range_shifted,
                                             &halt_cond))) {
       return E_FAIL;
     }
     std::wstring total_string;
-    if (FAILED(TipRangeUtil::GetText(preceeding_range, edit_cookie,
+    if (FAILED(TipRangeUtil::GetText(preceding_range, edit_cookie,
                                      &total_string))) {
       return E_FAIL;
     }
@@ -278,15 +278,15 @@ class PrecedingTextDeleter : public ITfEditSession {
     }
 
     const LONG final_offset = total_string.size() - len_in_utf16;
-    if (FAILED(preceeding_range->ShiftStart(edit_cookie, final_offset,
-                                            &preceeding_range_shifted,
+    if (FAILED(preceding_range->ShiftStart(edit_cookie, final_offset,
+                                            &preceding_range_shifted,
                                             &halt_cond))) {
       return E_FAIL;
     }
-    if (final_offset != preceeding_range_shifted) {
+    if (final_offset != preceding_range_shifted) {
       return E_FAIL;
     }
-    if (FAILED(preceeding_range->SetText(edit_cookie, 0, L"", 0))) {
+    if (FAILED(preceding_range->SetText(edit_cookie, 0, L"", 0))) {
       return E_FAIL;
     }
 
diff --git win32/tip/tip_surrounding_text.h win32/tip/tip_surrounding_text.h
index 2c11604ed..86cd131bb 100644
--- win32/tip/tip_surrounding_text.h
+++ win32/tip/tip_surrounding_text.h
@@ -86,7 +86,7 @@ class TipSurroundingText {
                                             TipSurroundingTextInfo *info,
                                             bool *need_async_reconversion);
 
-  // Returns true when succeeds to delete preceeding text from the beginning of
+  // Returns true when succeeds to delete preceding text from the beginning of
   // the selected range.
   // Caveats: |num_characters_to_be_deleted_in_ucs4| is not the number of
   //     elements in UTF16. Beware of surrogate pairs.
diff --git win32/tip/tip_text_service.cc win32/tip/tip_text_service.cc
index eea0b3fe1..8bccab402 100644
--- win32/tip/tip_text_service.cc
+++ win32/tip/tip_text_service.cc
@@ -88,7 +88,7 @@ using ATL::CComQIPtr;
 // Represents the module handle of this module.
 volatile HMODULE g_module = nullptr;
 
-// True if the the DLL received DLL_PROCESS_DETACH notification.
+// True if the DLL received DLL_PROCESS_DETACH notification.
 volatile bool g_module_unloaded = false;
 
 // Thread Local Storage (TLS) index to specify the current UI thread is
@@ -877,7 +877,7 @@ class TipTextServiceImpl : public ITfTextInputProcessorEx,
   virtual HRESULT STDMETHODCALLTYPE OnSetThreadFocus() {
     EnsureKanaLockUnlocked();
 
-    // A temporary workaround for b/24793812.  When previous atempt to
+    // A temporary workaround for b/24793812.  When previous attempt to
     // establish conection failed, retry again as if this was the first attempt.
     // TODO(yukawa): We should give up if this fails a number of times.
     if (WinUtil::IsProcessSandboxed()) {
diff --git win32/tip/tip_ui_element_immersive.cc win32/tip/tip_ui_element_immersive.cc
index 336991bbf..9a2e4ab00 100644
--- win32/tip/tip_ui_element_immersive.cc
+++ win32/tip/tip_ui_element_immersive.cc
@@ -108,7 +108,7 @@ const wchar_t kImmersiveUIWindowClassName[] = L"Mozc Immersive UI Window";
 // Represents the module handle of this module.
 volatile HMODULE g_module = nullptr;
 
-// True if the the DLL received DLL_PROCESS_DETACH notification.
+// True if the DLL received DLL_PROCESS_DETACH notification.
 volatile bool g_module_unloaded = false;
 
 // Thread Local Storage (TLS) index to specify the current UI thread is
diff --git win32/tip/tip_ui_handler_immersive.cc win32/tip/tip_ui_handler_immersive.cc
index f96a01138..4bdeed54e 100644
--- win32/tip/tip_ui_handler_immersive.cc
+++ win32/tip/tip_ui_handler_immersive.cc
@@ -69,7 +69,7 @@ typedef ::mozc::commands::Preedit_Segment::Annotation Annotation;
 // Represents the module handle of this module.
 volatile HMODULE g_module = nullptr;
 
-// True if the the DLL received DLL_PROCESS_DETACH notification.
+// True if the DLL received DLL_PROCESS_DETACH notification.
 volatile bool g_module_unloaded = false;
 
 // Thread Local Storage (TLS) index to specify the current UI thread is